Class ClassModel
- java.lang.Object
-
- org.eclipse.yasson.internal.model.ClassModel
-
public class ClassModel extends java.lang.Object
A model for Java class.
-
-
Constructor Summary
Constructors Constructor Description ClassModel(java.lang.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(java.lang.String jsonReadName)
Search for field in this class model and superclasses of its class.ClassCustomization
getClassCustomization()
Introspected customization for a class.java.lang.reflect.Constructor<?>
getDefaultConstructor()
Default no argument constructor of the class used for deserialization.ClassModel
getParentClassModel()
Class model of parent class if present.java.util.Map<java.lang.String,PropertyModel>
getProperties()
Get class properties copy, combination of field and its getter / setter, javabeans alike.PropertyModel
getPropertyModel(java.lang.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.java.lang.Class<?>
getType()
Gets type.void
setProperties(java.util.List<PropertyModel> parsedProperties)
Sets parsed properties of the class.
-
-
-
Constructor Detail
-
ClassModel
public ClassModel(java.lang.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(java.lang.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(java.lang.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.
-
getType
public java.lang.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(java.util.List<PropertyModel> parsedProperties)
Sets parsed properties of the class.- Parameters:
parsedProperties
- class properties
-
getProperties
public java.util.Map<java.lang.String,PropertyModel> getProperties()
Get class properties copy, combination of field and its getter / setter, javabeans alike.- Returns:
- class properties.
-
getDefaultConstructor
public java.lang.reflect.Constructor<?> getDefaultConstructor()
Default no argument constructor of the class used for deserialization.- Returns:
- default constructor
-
-