Package org.simpleframework.xml.strategy
Class Contract
java.lang.Object
org.simpleframework.xml.strategy.Contract
The
Contract
object is used to expose the attribute
names used by the cycle strategy. This ensures that reading and
writing of the XML document is done in a consistent manner. Each
attribute is used to mark special meta-data for the object graph.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
This is the label used to mark the type of an object.private String
This is used to specify the length of array instances.private String
This is the attribute used to mark the identity of an object.private String
This is the attribute used to refer to an existing instance. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis returns the attribute used to store the identities of all objects serialized to the XML document.getLabel()
This is returns the attribute used to store information about the type to the XML document.This returns the attribute used to store the array length in the serialized XML document.This returns the attribute used to store references within the serialized XML document.
-
Field Details
-
length
This is used to specify the length of array instances. -
label
This is the label used to mark the type of an object. -
mark
This is the attribute used to mark the identity of an object. -
refer
This is the attribute used to refer to an existing instance.
-
-
Constructor Details
-
Contract
Constructor for theSyntax
object. This is used to expose the attribute names used by the strategy. All the names can be acquired and shared by the read and write graph objects, which ensures consistency between the two objects.- Parameters:
mark
- this is used to mark the identity of an objectrefer
- this is used to refer to an existing objectlabel
- this is used to specify the class for the fieldlength
- this is the length attribute used for arrays
-
-
Method Details
-
getLabel
This is returns the attribute used to store information about the type to the XML document. This attribute name is used to add data to XML elements to enable the deserialization process to know the exact instance to use when creating a type.- Returns:
- the name of the attribute used to store the type
-
getReference
This returns the attribute used to store references within the serialized XML document. The reference attribute is added to the serialized XML element so that cycles in the object graph can be recreated. This is an optional attribute.- Returns:
- this returns the name of the reference attribute
-
getIdentity
This returns the attribute used to store the identities of all objects serialized to the XML document. The identity attribute stores a unique identifiers, which enables this strategy to determine an objects identity within the serialized XML.- Returns:
- this returns the name of the identity attribute used
-
getLength
This returns the attribute used to store the array length in the serialized XML document. The array length is required so that the deserialization process knows how to construct the array before any of the array elements are deserialized.- Returns:
- this returns the name of the array length attribute
-