Package org.simpleframework.xml.core
Class FieldDetail
- java.lang.Object
-
- org.simpleframework.xml.core.FieldDetail
-
class FieldDetail extends java.lang.Object
TheFieldDetail
represents a field and acts as a means to cache all of the details associated with the field. This is primarily used to cache data associated with the field as some platforms do not perform well with reflection.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.reflect.Field
field
This is the field that this instance is representing.private java.lang.annotation.Annotation[]
list
This contains all the annotations declared on the field.private java.lang.String
name
This contains the name of the field that is represented.
-
Constructor Summary
Constructors Constructor Description FieldDetail(java.lang.reflect.Field field)
Constructor for theFieldDetail
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.annotation.Annotation[]
getAnnotations()
This returns the list of annotations that are associated with the field.java.lang.reflect.Field
getField()
This is the field that is represented by this detail.java.lang.String
getName()
This is used to extract the name of the field.
-
-
-
Field Detail
-
list
private final java.lang.annotation.Annotation[] list
This contains all the annotations declared on the field.
-
field
private final java.lang.reflect.Field field
This is the field that this instance is representing.
-
name
private final java.lang.String name
This contains the name of the field that is represented.
-
-
Constructor Detail
-
FieldDetail
public FieldDetail(java.lang.reflect.Field field)
Constructor for theFieldDetail
object. This takes a field that has been extracted from a class. All of the details such as the annotations and the field name are stored.- Parameters:
field
- this is the field that is represented by this
-
-
Method Detail
-
getAnnotations
public java.lang.annotation.Annotation[] getAnnotations()
This returns the list of annotations that are associated with the field. The annotations are extracted only once and cached internally, which improves the performance of serialization as reflection on the field needs to be performed only once.- Returns:
- this returns the annotations associated with the field
-
getField
public java.lang.reflect.Field getField()
This is the field that is represented by this detail. The field is provided so that it can be invoked to set or get the data that is referenced by the field during serialization.- Returns:
- this returns the field represented by this detail
-
getName
public java.lang.String getName()
This is used to extract the name of the field. The name here is the actual name of the field rather than the name used by the XML representation of the field.- Returns:
- this returns the actual name of the field
-
-