- java.lang.Object
-
- org.eclipse.yasson.internal.model.ClassModel
-
public class ClassModel extends Object
A model for Java class.
-
-
Constructor Summary
Constructors Constructor Description ClassModel(Class<?> clazz, ClassCustomization customization, ClassModel parentClassModel, jakarta.json.bind.config.PropertyNamingStrategy propertyNamingStrategy)Create instance of class model.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PropertyModelfindPropertyModelByJsonReadName(String jsonReadName)Search for field in this class model and superclasses of its class.ClassCustomizationgetClassCustomization()Introspected customization for a class.Constructor<?>getDefaultConstructor()Default no argument constructor of the class used for deserialization.ClassModelgetParentClassModel()Class model of parent class if present.Map<String,PropertyModel>getProperties()Get class properties copy, combination of field and its getter / setter, javabeans alike.PropertyModelgetPropertyModel(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.voidsetProperties(List<PropertyModel> parsedProperties)Sets parsed properties of the class.
-
-
-
Constructor Detail
-
ClassModel
public ClassModel(Class<?> clazz, ClassCustomization customization, ClassModel parentClassModel, jakarta.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.
-
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.
-
getDefaultConstructor
public Constructor<?> getDefaultConstructor()
Default no argument constructor of the class used for deserialization.- Returns:
- default constructor
-
-