Class ClassModel
- java.lang.Object
-
- org.eclipse.yasson.internal.model.ClassModel
-
public class ClassModel extends Object
A model for Java class.- Author:
- Dmitry Kornilov
-
-
Constructor Summary
Constructors Constructor Description ClassModel(Class<?> clazz, ClassCustomization customization, ClassModel parentClassModel, javax.json.bind.config.PropertyNamingStrategy propertyNamingStrategy)
Create instance of class model.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PropertyModel
findPropertyModelByJsonReadName(String jsonReadName)
Search for field in this class model and superclasses of its class.ClassCustomization
getClassCustomization()
Introspected customization for a class.ClassCustomization
getCustomization()
Gets customization.ClassModel
getParentClassModel()
Class model of parent class if present.Map<String,PropertyModel>
getProperties()
Get class properties copy, combination of field and its getter / setter, javabeans alike.PropertyModel
getPropertyModel(String name)
Gets a property model by default (non customized) name.PropertyModel[]
getSortedProperties()
Get sorted class properties copy, combination of field and its getter / setter, javabeans alike.Class<?>
getType()
Gets type.void
setProperties(List<PropertyModel> parsedProperties)
Sets parsed properties of the class.
-
-
-
Constructor Detail
-
ClassModel
public ClassModel(Class<?> clazz, ClassCustomization customization, ClassModel parentClassModel, javax.json.bind.config.PropertyNamingStrategy propertyNamingStrategy)
Create instance of class model.- Parameters:
clazz
- Class to model.customization
- Customization of the class parsed from annotations.parentClassModel
- Class model of parent class.propertyNamingStrategy
- Property naming strategy.
-
-
Method Detail
-
getPropertyModel
public PropertyModel getPropertyModel(String name)
Gets a property model by default (non customized) name.- Parameters:
name
- A name as parsed from field / getter / setter without annotation customizing.- Returns:
- Property model.
-
findPropertyModelByJsonReadName
public PropertyModel findPropertyModelByJsonReadName(String jsonReadName)
Search for field in this class model and superclasses of its class.- Parameters:
jsonReadName
- name as it appears in JSON during reading.- Returns:
- PropertyModel if found.
-
getCustomization
public ClassCustomization getCustomization()
Gets customization.- Returns:
- Customization.
-
getType
public Class<?> getType()
Gets type.- Returns:
- Type.
-
getClassCustomization
public ClassCustomization getClassCustomization()
Introspected customization for a class.- Returns:
- Immutable class customization.
-
getParentClassModel
public ClassModel getParentClassModel()
Class model of parent class if present.- Returns:
- class model of a parent
-
getSortedProperties
public PropertyModel[] getSortedProperties()
Get sorted class properties copy, combination of field and its getter / setter, javabeans alike.- Returns:
- sorted class properties.
-
setProperties
public void setProperties(List<PropertyModel> parsedProperties)
Sets parsed properties of the class.- Parameters:
parsedProperties
- class properties
-
getProperties
public Map<String,PropertyModel> getProperties()
Get class properties copy, combination of field and its getter / setter, javabeans alike.- Returns:
- class properties.
-
-