Class SerializableFieldMeta

java.lang.Object
com.emc.documentum.rest.parser.meta.SerializableFieldMeta

public class SerializableFieldMeta extends Object
Metadata for a serializable field in a class.
  • Constructor Details

    • SerializableFieldMeta

      public SerializableFieldMeta()
      Default constructor.
    • SerializableFieldMeta

      public SerializableFieldMeta(Field field, SerializableType typeAnnotation, SerializableField fieldAnnotation, SerializableField4XmlList field4XmlListAnnotation, SerializableField4XmlMap field4XmlMapAnnotation, com.emc.documentum.rest.binding.SanitizeConfig sanitizeConfig)
      Constructor with parameters.
      Parameters:
      field - field on the class definition
      typeAnnotation - type annotation
      fieldAnnotation - field annotation
      field4XmlListAnnotation - field for xml list annotation
      field4XmlMapAnnotation - field for xml map annotation
      sanitizeConfig - config for sanitize
  • Method Details

    • serializableName

      public String serializableName()
      Get the serializable name.
      Returns:
      the serializable name
    • field

      public Field field()
      Get the field on class definition.
      Returns:
      the field
    • isList

      public boolean isList()
      Check whether the field type is list or array.
      Returns:
      true when it is a list or array; false otherwise
    • isMap

      public boolean isMap()
      Check whether the field type is map.
      Returns:
      true when it is a map; false otherwise
    • isWrappedList

      public boolean isWrappedList()
      Check whether the field type is list and the list is wrapped.
      Returns:
      true when it is a wrapped list; false otherwise
    • isSimpleDataType

      public boolean isSimpleDataType()
      Check whether the field type is simple. Primitive types, String, Date, Integer and Enum are taken as simple data types.
      Returns:
      true when it is a simple data type; false otherwise
    • listItemType

      public Class listItemType()
      Get the item type for the list data type.
      Returns:
      list item type
    • mapValueType

      public Class mapValueType()
      Get the entry value type for the map data type.
      Returns:
      entry value type
    • isDataTypeOf

      public boolean isDataTypeOf(Class<?> dataType)
      Return the flag whether actual value data type is the same as the field data type, the list item type if the field is a list, or the map value type if the field is a map.
      Parameters:
      dataType - data type
      Returns:
      true if the data type matches; false otherwise
    • required

      public boolean required()
      Check whether the field value is required for the class.
      Returns:
      true when it is required; false otherwise
    • dataType

      public Class dataType()
      Get the field data type.
      Returns:
      the field data type
    • isEntry

      public boolean isEntry()
      Check whether the field type is entry.
      Returns:
      true when it is an entry; false otherwise
    • isSkipSanitize

      public boolean isSkipSanitize()
      Whether skip the field sanitize
      Returns:
      true if the field skips sanitization
    • isEnforceSanitize

      public boolean isEnforceSanitize()
      Whether enforce the field sanitize
      Returns:
      true if the field enforce sanitization
    • getEntryMeta

      public com.emc.documentum.rest.parser.meta.SerializableEntryMeta getEntryMeta()
      Get the entry metadata.
      Returns:
      the entry metadata
    • xmlUnwrap

      public boolean xmlUnwrap()
      Check whether the field is serialized as unwrapped list for xml.
      Returns:
      true when it is serialized as xml unwrapped list; false otherwise
    • xmlListAsPropBag

      public boolean xmlListAsPropBag()
      Check whether the field type is serialized as the property bag for xml.
      Returns:
      true when it is serialized as property bag for xml; false otherwise
    • xmlListPropBagName

      public String xmlListPropBagName()
      Get the list item property bag name for xml.
      Returns:
      the list item property bag name
    • xmlMapAsPropBag

      public boolean xmlMapAsPropBag()
      Check whether the field type is serialized as map property bag in xml.
      Returns:
      true when it is serialized as xml map property bag; false otherwise
    • xmlMapEntryAsEleName

      public String xmlMapEntryAsEleName()
      Get the map property bag name as the xml element name under the map element.
      Returns:
      the map property bag name
    • xmlMapKeyAsAttrName

      public String xmlMapKeyAsAttrName()
      Get the map key name as xml attribute.
      Returns:
      the map key name
    • asXmlAttribute

      public boolean asXmlAttribute()
      Check whether the field type is serialized as attribute for xml.
      Returns:
      true when it is ; false otherwise
    • xmlNS

      public String xmlNS()
      Get xml namespace.
      Returns:
      xml namespace
    • xmlNSPrefix

      public String xmlNSPrefix()
      Get xml namespace prefix.
      Returns:
      xml namespace prefix
    • ignoreNull

      public boolean ignoreNull()
      Check whether the field type ignores null value during serialization.
      Returns:
      true when it ignores null; false otherwise
    • isXmlValue

      public boolean isXmlValue()
      Check whether the field type serializes as the value of the class for xml.
      Returns:
      true when it does; false otherwise
    • isXmlSpacePreserve

      public boolean isXmlSpacePreserve()
      Check whether the field type preserves space in xml serialization.
      Returns:
      true when it preserves space; false otherwise
    • isOverride

      public boolean isOverride()
      Check whether the field type overrides its parent class's field definition.
      Returns:
      true when it overrides parent's field; false otherwise
    • xmlWriteTypeRoot

      public boolean xmlWriteTypeRoot()
      Check whether the field type serializes the type name as root element name for xml.
      Returns:
      true when it does; false otherwise
    • defaultImpl

      public Class defaultImpl()
      Get default implementation class set for the field.
      Returns:
      the default implementation class
    • serializers

      public Class<? extends AnnotatedFieldSerializer>[] serializers()
      Get field serializers for the field.
      Returns:
      field serializers
    • deserializers

      public Class<? extends AnnotatedFieldDeserializer>[] deserializers()
      Get field deserializers for the field.
      Returns:
      field deserializers
    • setParameterizedType

      public void setParameterizedType(Type parameterizedType)
      Set the parameterized type for the field when there is type parameter defined on the field.
      Parameters:
      parameterizedType - the parameterized type
    • dataTypeResolved

      public boolean dataTypeResolved()
      Check whether the data type for the field has been resolved; for instance, when generic is used, the field itself does not have the type argument information so that the field type needs to be resolved externally.
      Returns:
      true if it is resolved; false otherwise
    • shallowCopy

      public SerializableFieldMeta shallowCopy()
      Copy the field meta in a shallow mean which shares the read-only members.
      Returns:
      the copied field meta
    • unknownFieldDeserializers

      public Class<? extends AnnotatedFieldDeserializer>[] unknownFieldDeserializers()
      Get the unknown field deserializers defined on the type annotation.
      Returns:
      the unknown field deserializers