Class FieldDetail

java.lang.Object
org.simpleframework.xml.core.FieldDetail

class FieldDetail extends Object
The FieldDetail 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 final Field
    This is the field that this instance is representing.
    private final Annotation[]
    This contains all the annotations declared on the field.
    private final String
    This contains the name of the field that is represented.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor for the FieldDetail object.
  • Method Summary

    Modifier and Type
    Method
    Description
    This returns the list of annotations that are associated with the field.
    This is the field that is represented by this detail.
    This is used to extract the name of the field.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • list

      private final Annotation[] list
      This contains all the annotations declared on the field.
    • field

      private final Field field
      This is the field that this instance is representing.
    • name

      private final String name
      This contains the name of the field that is represented.
  • Constructor Details

    • FieldDetail

      public FieldDetail(Field field)
      Constructor for the FieldDetail 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 Details

    • getAnnotations

      public 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 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 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