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
ConstructorDescriptionPropertyModel
(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 TypeMethodDescriptionint
boolean
Model of declaring class of this property.Introspected customization of a property.getField()
Field of a javabean property.Setter of a 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.Gets a name of JSON document property to read this property from.Getter of a javabean property.Gets property's value.int
hashCode()
static boolean
isPropertyReadable
(Field field, Method getter, jakarta.json.bind.config.PropertyVisibilityStrategy strategy) boolean
Property is readable.boolean
Property is writable.void
Sets 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:
compareTo
in 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
-
getField
Field of a javabean property.- Returns:
field
-
getGetter
Setter of a javabean property.- Returns:
getter
-
getSetter
Getter of a javabean property.- Returns:
setter
-
isPropertyReadable
-
getGetValueHandle
-
getSetValueHandle
-