public static class SerializationClass.Attribute extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Field |
field |
protected Method |
getter |
protected boolean |
ignore |
protected String |
name |
protected String |
originalName |
protected TypeDefinition |
originalType |
protected SerializationClass |
parent |
protected Method |
setter |
protected TypeDefinition |
type |
| Constructor and Description |
|---|
Attribute(SerializationClass.Attribute copy)
Constructor.
|
Attribute(SerializationClass parent,
Field f)
Constructor.
|
Attribute(SerializationClass parent,
String name,
TypeDefinition type)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canGet()
Return true if a getter exists or the field is public.
|
boolean |
canSet()
Return true if a setter exists or the field is public.
|
<T extends Annotation> |
getAnnotation(boolean onGet,
Class<T> annotationType)
Retrieve a specific annotation.
|
List<Annotation> |
getAnnotations(boolean onGet)
Retrieve all annotations.
|
Class<?> |
getDeclaringClass()
Return the declaring class of the field or the getter or the setter.
|
Field |
getField() |
Method |
getGetter() |
String |
getName() |
String |
getOriginalName() |
TypeDefinition |
getOriginalType() |
SerializationClass |
getParent() |
Method |
getSetter() |
TypeDefinition |
getType() |
Object |
getValue(Object instance)
Return the value of this attribute for the given instance.
|
boolean |
hasCustomInstantiation()
Return true if this attribute has a custom instantiation and no type information should not be serialized.
|
boolean |
ignore()
Return true if this attribute must be ignored during (de)serialization.
|
void |
ignore(boolean ignore)
Set the ignore flag.
|
Object |
instantiate(SerializationContext.AttributeContext context)
Instantiate a new object of the type of this attribute.
|
void |
renameTo(String newName)
Rename this attribute.
|
void |
setType(TypeDefinition type) |
void |
setValue(Object instance,
Object value)
Set the value of this attribute for the given instance.
|
protected SerializationClass parent
protected String name
protected String originalName
protected Field field
protected Method getter
protected Method setter
protected TypeDefinition type
protected TypeDefinition originalType
protected boolean ignore
public Attribute(SerializationClass parent, String name, TypeDefinition type)
public Attribute(SerializationClass parent, Field f)
public Attribute(SerializationClass.Attribute copy)
public SerializationClass getParent()
public String getName()
public String getOriginalName()
public Field getField()
public Method getGetter()
public Method getSetter()
public TypeDefinition getType()
public TypeDefinition getOriginalType()
public boolean ignore()
public void ignore(boolean ignore)
public void renameTo(String newName)
public void setType(TypeDefinition type)
public Class<?> getDeclaringClass()
public boolean canGet()
public boolean canSet()
public Object getValue(Object instance) throws SerializationException
SerializationExceptionpublic void setValue(Object instance, Object value) throws SerializationException
SerializationExceptionpublic Object instantiate(SerializationContext.AttributeContext context) throws SerializationException
SerializationExceptionpublic boolean hasCustomInstantiation()
public <T extends Annotation> T getAnnotation(boolean onGet, Class<T> annotationType)
public List<Annotation> getAnnotations(boolean onGet)
Copyright © 2019. All rights reserved.