Class Property
- java.lang.Object
-
- org.eclipse.yasson.internal.model.Property
-
public class Property extends Object
Property of a class, field, getter and setter methods (javabean alike). Used during class model initialization, than dereferenced.- Author:
- Roman Grigoriadi
-
-
Constructor Summary
Constructors Constructor Description Property(String name, JsonbAnnotatedElement<Class<?>> declaringClassModel)
Create instance of property.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JsonbAnnotatedElement<Class<?>>
getDeclaringClassElement()
Class element with annotation under construction for declaring class of this property.Field
getField()
Field
representing property if anyJsonbAnnotatedElement<Field>
getFieldElement()
Element with field and its annotations.Method
getGetter()
Method
representing getter of a property if any.JsonbAnnotatedElement<Method>
getGetterElement()
Element with getter and its annotations.Type
getGetterType()
String
getName()
Name of a property, java bean convention.Type
getPropertyType()
Extracts type from first not null element: Field, Getter, Setter.Method
getSetter()
Method
representing setter of a property if any.JsonbAnnotatedElement<Method>
getSetterElement()
Element with setter and its annotations.Type
getSetterType()
void
setField(Field field)
void
setGetter(Method getter)
void
setSetter(Method setter)
-
-
-
Constructor Detail
-
Property
public Property(String name, JsonbAnnotatedElement<Class<?>> declaringClassModel)
Create instance of property.- Parameters:
name
- not nulldeclaringClassModel
- Class model for a class declaring property.
-
-
Method Detail
-
getName
public String getName()
Name of a property, java bean convention.- Returns:
- name
-
setField
public void setField(Field field)
- Parameters:
field
- field not null
-
getGetter
public Method getGetter()
Method
representing getter of a property if any.- Returns:
- getter if present
-
setGetter
public void setGetter(Method getter)
- Parameters:
getter
- not null
-
getSetter
public Method getSetter()
Method
representing setter of a property if any.- Returns:
- setter if present
-
setSetter
public void setSetter(Method setter)
- Parameters:
setter
- setter not null
-
getDeclaringClassElement
public JsonbAnnotatedElement<Class<?>> getDeclaringClassElement()
Class element with annotation under construction for declaring class of this property. This ClassModel is not fully initialized yet.- Returns:
- ClassModel
-
getPropertyType
public Type getPropertyType()
Extracts type from first not null element: Field, Getter, Setter.- Returns:
- type of a property
-
getGetterType
public Type getGetterType()
-
getSetterType
public Type getSetterType()
-
getFieldElement
public JsonbAnnotatedElement<Field> getFieldElement()
Element with field and its annotations.- Returns:
- field with annotations
-
getGetterElement
public JsonbAnnotatedElement<Method> getGetterElement()
Element with getter and its annotations.- Returns:
- getter with annotations
-
getSetterElement
public JsonbAnnotatedElement<Method> getSetterElement()
Element with setter and its annotations.- Returns:
- setter with annotations
-
-