Class PropertyModel
java.lang.Object
org.eclipse.yasson.internal.model.PropertyModel
- All Implemented Interfaces:
Comparable<PropertyModel>
A model for class property.
Property is JavaBean alike meta information field / getter / setter of a property in class.
-
Constructor Summary
ConstructorsConstructorDescriptionPropertyModel(ClassModel classModel, Property property, JsonbContext jsonbContext) Creates an instance.Create a new PropertyModel that merges two existing PropertyModel that have identical read/write names. -
Method Summary
Modifier and TypeMethodDescriptionintbooleanModel of declaring class of this property.Introspected customization of a property.Wrapper object ofjava.lang.reflectrepresentations of this javabean property.Returns which type should be used to deserialization.Default property name according to Field / Getter / Setter method names.Returns which type should be used to serialization.javax.json.bind.serializer.JsonbSerializer<?>Gets serializer.Gets a name of JSON document property to read this property from.Gets property's value.inthashCode()booleanProperty is readable.booleanProperty is writable.voidSets a property.
-
Constructor Details
-
PropertyModel
Create a new PropertyModel that merges two existing PropertyModel that have identical read/write names. The input PropertyModel objects MUST be equal (a.equals(b) == true)- Parameters:
a- a PropertyModel instance to mergeb- the other PropertyModel instance to merge
-
PropertyModel
Creates an instance.- Parameters:
classModel- Class model of declaring class.property- Property.jsonbContext- Context.
-
-
Method Details
-
getPropertyDeserializationType
Returns which type should be used to deserialization.- Returns:
- deserialization type
-
getPropertySerializationType
Returns which type should be used to serialization.- Returns:
- serialization type
-
getValue
Gets property's value.- Parameters:
object- object to read property from- Returns:
- property's value
-
setValue
Sets a property. If not writable (final, transient, static), ignores property.- Parameters:
object- Object to set value in.value- Value to set.
-
isReadable
public boolean isReadable()Property is readable. Based on access policy and java field modifiers.- Returns:
- true if can be serialized to JSON
-
isWritable
public boolean isWritable()Property is writable. Based on access policy and java field modifiers.- Returns:
- true if can be deserialized from JSON
-
getPropertyName
Default property name according to Field / Getter / Setter method names. This name is use for identifying properties, for JSON serialization is used customized name which may be derived from default name.- Returns:
- default name
-
getClassModel
Model of declaring class of this property.- Returns:
- class model
-
getCustomization
Introspected customization of a property.- Returns:
- immutable property customization
-
compareTo
- Specified by:
compareToin interfaceComparable<PropertyModel>
-
equals
-
hashCode
public int hashCode() -
getReadName
Gets a name of JSON document property to read this property from.- Returns:
- Name of JSON document property.
-
getWriteName
-
getPropertySerializer
public javax.json.bind.serializer.JsonbSerializer<?> getPropertySerializer()Gets serializer.- Returns:
- Serializer.
-
getPropagation
Wrapper object ofjava.lang.reflectrepresentations of this javabean property.- Returns:
- Property model
-