Class SerializableFieldMeta
java.lang.Object
com.emc.documentum.rest.parser.meta.SerializableFieldMeta
Metadata for a serializable field in a class.
-
Constructor Summary
ConstructorDescriptionDefault constructor.SerializableFieldMeta
(Field field, SerializableType typeAnnotation, SerializableField fieldAnnotation, SerializableField4XmlList field4XmlListAnnotation, SerializableField4XmlMap field4XmlMapAnnotation, com.emc.documentum.rest.binding.SanitizeConfig sanitizeConfig) Constructor with parameters. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Check whether the field type is serialized as attribute for xml.dataType()
Get the field data type.boolean
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.Get default implementation class set for the field.Class<? extends AnnotatedFieldDeserializer>[]
Get field deserializers for the field.field()
Get the field on class definition.com.emc.documentum.rest.parser.meta.SerializableEntryMeta
Get the entry metadata.boolean
Check whether the field type ignores null value during serialization.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.boolean
Whether enforce the field sanitizeboolean
isEntry()
Check whether the field type is entry.boolean
isList()
Check whether the field type is list or array.boolean
isMap()
Check whether the field type is map.boolean
Check whether the field type overrides its parent class's field definition.boolean
Check whether the field type is simple.boolean
Whether skip the field sanitizeboolean
Check whether the field type is list and the list is wrapped.boolean
Check whether the field type preserves space in xml serialization.boolean
Check whether the field type serializes as the value of the class for xml.Get the item type for the list data type.Get the entry value type for the map data type.boolean
required()
Check whether the field value is required for the class.Get the serializable name.Class<? extends AnnotatedFieldSerializer>[]
Get field serializers for the field.void
setParameterizedType
(Type parameterizedType) Set the parameterized type for the field when there is type parameter defined on the field.Copy the field meta in a shallow mean which shares the read-only members.Class<? extends AnnotatedFieldDeserializer>[]
Get the unknown field deserializers defined on the type annotation.boolean
Check whether the field type is serialized as the property bag for xml.Get the list item property bag name for xml.boolean
Check whether the field type is serialized as map property bag in xml.Get the map property bag name as the xml element name under the map element.Get the map key name as xml attribute.xmlNS()
Get xml namespace.Get xml namespace prefix.boolean
Check whether the field is serialized as unwrapped list for xml.boolean
Check whether the field type serializes the type name as root element name for xml.
-
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 definitiontypeAnnotation
- type annotationfieldAnnotation
- field annotationfield4XmlListAnnotation
- field for xml list annotationfield4XmlMapAnnotation
- field for xml map annotationsanitizeConfig
- config for sanitize
-
-
Method Details
-
serializableName
Get the serializable name.- Returns:
- the serializable name
-
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
Get the item type for the list data type.- Returns:
- list item type
-
mapValueType
Get the entry value type for the map data type.- Returns:
- entry value type
-
isDataTypeOf
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
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
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
Get the map property bag name as the xml element name under the map element.- Returns:
- the map property bag name
-
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
Get xml namespace.- Returns:
- xml namespace
-
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
Get default implementation class set for the field.- Returns:
- the default implementation class
-
serializers
Get field serializers for the field.- Returns:
- field serializers
-
deserializers
Get field deserializers for the field.- Returns:
- field deserializers
-
setParameterizedType
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
Copy the field meta in a shallow mean which shares the read-only members.- Returns:
- the copied field meta
-
unknownFieldDeserializers
Get the unknown field deserializers defined on the type annotation.- Returns:
- the unknown field deserializers
-