Package org.simpleframework.xml.strategy
Class Contract
- java.lang.Object
-
- org.simpleframework.xml.strategy.Contract
-
class Contract extends java.lang.Object
TheContract
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:
CycleStrategy
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
label
This is the label used to mark the type of an object.private java.lang.String
length
This is used to specify the length of array instances.private java.lang.String
mark
This is the attribute used to mark the identity of an object.private java.lang.String
refer
This is the attribute used to refer to an existing instance.
-
Constructor Summary
Constructors Constructor Description Contract(java.lang.String mark, java.lang.String refer, java.lang.String label, java.lang.String length)
Constructor for theSyntax
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getIdentity()
This returns the attribute used to store the identities of all objects serialized to the XML document.java.lang.String
getLabel()
This is returns the attribute used to store information about the type to the XML document.java.lang.String
getLength()
This returns the attribute used to store the array length in the serialized XML document.java.lang.String
getReference()
This returns the attribute used to store references within the serialized XML document.
-
-
-
Field Detail
-
length
private java.lang.String length
This is used to specify the length of array instances.
-
label
private java.lang.String label
This is the label used to mark the type of an object.
-
mark
private java.lang.String mark
This is the attribute used to mark the identity of an object.
-
refer
private java.lang.String refer
This is the attribute used to refer to an existing instance.
-
-
Constructor Detail
-
Contract
public Contract(java.lang.String mark, java.lang.String refer, java.lang.String label, java.lang.String length)
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 Detail
-
getLabel
public java.lang.String 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
public java.lang.String 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
public java.lang.String 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
public java.lang.String 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
-
-