C# Class SimpleFramework.Xml.Core.Composite

The Composite object is used to perform serialization of objects that contain XML annotation. Composite objects are objects that are not primitive and contain references to serializable fields. This Converter will visit each field within the object and deserialize or serialize that field depending on the requested action. If a required field is not present when deserializing from an XML element this terminates the deserialization reports the error. <element name="test" class="some.package.Type"> <text>string value</text> <integer>1234</integer> </element> To deserialize the above XML source this will attempt to match the attribute name with an Attribute annotation from the XML schema class, which is specified as "some.package.Type". This type must also contain Element annotations for the "text" and "integer" elements.

Serialization requires that contacts marked as required must have values that are not null. This ensures that the serialized object can be deserialized at a later stage using the same class schema. If a required value is null the serialization terminates and an exception is thrown.

Inheritance: Converter
Afficher le fichier Open project: ngallagher/simplexml

Méthodes publiques

Méthode Description
Composite ( Context context, Type type ) : SimpleFramework.Xml.Strategy

Constructor for the Composite object. This creates a converter object capable of serializing and deserializing root objects labeled with XML annotations. The XML schema class must be given to the instance in order to perform deserialization.

IsOverridden ( OutputNode node, Object value, Type type ) : bool

This is used to determine whether the specified value has been overridden by the strategy. If the item has been overridden then no more serialization is require for that value, this is effectively telling the serialization process to stop writing.

Read ( InputNode node ) : Object

This read method performs deserialization of the XML schema class type by traversing the contacts and instantiating them using details from the provided XML element. Because this will convert a non-primitive value it delegates to other converters to perform deserialization of lists and primitives.

If any of the required contacts are not present within the provided XML element this will terminate deserialization and throw an exception. The annotation missing is reported in the exception.

Read ( InputNode node, Instance value, Class real ) : Object

This read method performs deserialization of the XML schema class type by traversing the contacts and instantiating them using details from the provided XML element. Because this will convert a non-primitive value it delegates to other converters to perform deserialization of lists and primitives.

If any of the required contacts are not present within the provided XML element this will terminate deserialization and throw an exception. The annotation missing is reported in the exception.

Read ( InputNode node, Object source ) : Object

This read method performs deserialization of the XML schema class type by traversing the contacts and instantiating them using details from the provided XML element. Because this will convert a non-primitive value it delegates to other converters to perform deserialization of lists and primitives.

If any of the required contacts are not present within the provided XML element this will terminate deserialization and throw an exception. The annotation missing is reported in the exception.

Read ( InputNode node, Object source, Label label ) : Object

This read method is used to perform deserialization of the provided node object using a delegate converter. This is typically another Composite converter, or if the node is an attribute a Primitive converter. When the delegate converter has completed the deserialized value is assigned to the contact.

Read ( InputNode node, Schema schema, Instance value ) : Object

This read method performs deserialization of the XML schema class type by traversing the contacts and instantiating them using details from the provided XML element. Because this will convert a non-primitive value it delegates to other converters to perform deserialization of lists and primitives.

If any of the required contacts are not present within the provided XML element this will terminate deserialization and throw an exception. The annotation missing is reported in the exception.

Read ( InputNode node, Object source, Schema schema ) : void

This read method performs deserialization of the XML schema class type by traversing the contacts and instantiating them using details from the provided XML element. Because this will convert a non-primitive value it delegates to other converters to perform deserialization of lists and primitives.

If any of the required contacts are not present within the provided XML element this will terminate deserialization and throw an exception. The annotation missing is reported in the exception.

ReadAttribute ( InputNode node, Object source, LabelMap map ) : void

This readAttribute method is used for deserialization of the provided node object using a delegate converter. This is typically another Composite converter, or if the node is an attribute a Primitive converter. When the delegate converter has completed the deserialized value is assigned to the contact.

ReadAttributes ( InputNode node, Object source, Schema schema ) : void

This readAttributes method reads the attributes from the provided XML element. This will iterate over all attributes within the element and convert those attributes as primitives to contact values within the source object.

Once all attributes within the XML element have been evaluated the Schema is checked to ensure that there are no required contacts annotated with the Attribute that remain. If any required attribute remains an exception is thrown.

ReadConstructor ( InputNode node, Schema schema, Instance value ) : Object

This readConstructor method performs deserialization of the XML schema class type by traversing the contacts and creating them using details from the provided XML element. Because this will convert a non-primitive value it delegates to other converters to perform deserialization of lists and primitives.

This takes the approach of reading the XML elements and attributes before instantiating the object. Instantiation is performed using a declared constructor. The parameters for the constructor are taken from the deserialized objects.

ReadDefault ( InputNode node, Schema schema, Instance value ) : Object

This readDefault method performs deserialization of the XM schema class type by traversing the contacts and instantiating them using details from the provided XML element. Because this will convert a non-primitive value it delegates to other converters to perform deserialization of lists and primitives.

This takes the approach that the object is instantiated first and then the annotated fields and methods are deserialized from the XML elements and attributes. When all the details have be deserialized they are set on the internal contacts of the object.

ReadElement ( InputNode node, Object source, LabelMap map ) : void

This readElement method is used for deserialization of the provided node object using a delegate converter. This is typically another Composite converter, or if the node is an attribute a Primitive converter. When the delegate converter has completed the deserialized value is assigned to the contact.

ReadElements ( InputNode node, Object source, Schema schema ) : void

This readElements method reads the elements from the provided XML element. This will iterate over all elements within the element and convert those elements to primitives or composite objects depending on the contact annotation.

Once all elements within the XML element have been evaluated the Schema is checked to ensure that there are no required contacts annotated with the Element that remain. If any required element remains an exception is thrown.

ReadObject ( InputNode node, Object source, Label label ) : Object

This readObject method is used to perform the deserialization of the XML in to any original value. If there is no original value then this will do a read and instantiate a new value to deserialize in to. Reading in to the original ensures that existing lists or maps can be read in to.

ReadPrimitive ( InputNode node, Instance value ) : Object

This readPrimitive method will extract the text value from the node and replace any template variables before converting it to a primitive value. This uses a Primitive object to convert the node text to the resulting string. This will also respect all references on the node so cycle can be followed.

ReadResolve ( InputNode node, Object source, Caller caller ) : Object

The readResolve method is used to determine if there is a resolution method which can be used to substitute the object deserialized. The resolve method is used when an object wishes to provide a substitute within the deserialized object graph. This acts as an equivalent to the Java Object Serialization readResolve method for the object deserialization.

ReadText ( InputNode node, Object source, Schema schema ) : void

This readText method is used to read the text value from the XML element node specified. This will check the class schema to determine if a Text annotation was specified. If one was specified then the text within the XML element input node is used to populate the contact value.

ReadVersion ( InputNode node, Object source, Label label ) : void

This method is used to read the version from the provided input node. Once the version has been read it is used to determine how to deserialize the object. If the version is not the initial version then it is read in a manner that ignores excessive XML elements and attributes. Also none of the annotated fields or methods are required if the version is not the initial version.

ReadVersion ( InputNode node, Object source, Schema schema ) : void

This method is used to read the version from the provided input node. Once the version has been read it is used to determine how to deserialize the object. If the version is not the initial version then it is read in a manner that ignores excessive XML elements and attributes. Also none of the annotated fields or methods are required if the version is not the initial version.

Validate ( InputNode node ) : bool

This validate method performs validation of the XML schema class type by traversing the contacts and validating them using details from the provided XML element. Because this will validate a non-primitive value it delegates to other converters to perform validation of lists, maps, and primitives.

If any of the required contacts are not present within the given XML element this will terminate validation and throw an exception The annotation missing is reported in the exception.

Validate ( InputNode node, Class type ) : bool

This validate method performs validation of the XML schema class type by traversing the contacts and validating them using details from the provided XML element. Because this will validate a non-primitive value it delegates to other converters to perform validation of lists, maps, and primitives.

If any of the required contacts are not present within the given XML element this will terminate validation and throw an exception The annotation missing is reported in the exception.

Validate ( InputNode node, Label label ) : void

This validate method is used to perform validation of the provided node object using a delegate converter. This is typically another Composite converter, or if the node is an attribute a Primitive converter. If this fails validation then an exception is thrown to report the issue.

Validate ( InputNode node, LabelMap map ) : void

This method checks to see if there are any Label objects remaining in the provided map that are required. This is used when validation is performed to ensure the the XML element validated contains sufficient details to satisfy the XML schema class annotations. If there is a required label that remains it is reported within the exception thrown.

Validate ( InputNode node, LabelMap map, Object source ) : void

This method checks to see if there are any Label objects remaining in the provided map that are required. This is used when deserialization is performed to ensure the the XML element deserialized contains sufficient details to satisfy the XML schema class annotations. If there is a required label that remains it is reported within the exception thrown.

ValidateAttribute ( InputNode node, LabelMap map ) : void

This validateAttribute method performs a validation of the provided node object using a delegate converter. This is typically another Composite converter, or if the node is an attribute a Primitive converter. If this fails validation then an exception is thrown to report the issue.

ValidateAttributes ( InputNode node, Schema schema ) : void

This validateAttributes method validates the attributes from the provided XML element. This will iterate over all attributes within the element and validate those attributes as primitives to contact values within the source object.

Once all attributes within the XML element have been evaluated the Schema is checked to ensure that there are no required contacts annotated with the Attribute that remain. If any required attribute remains an exception is thrown.

ValidateElement ( InputNode node, LabelMap map ) : void

This validateElement method performs a validation of the provided node object using a delegate converter. This is typically another Composite converter, or if the node is an attribute a Primitive converter. If this fails validation then an exception is thrown to report the issue.

ValidateElements ( InputNode node, Schema schema ) : void

This validateElements method validates the elements from the provided XML element. This will iterate over all elements within the element and validate those elements as primitives or composite objects depending on the contact annotation.

Once all elements within the XML element have been evaluated the Schema is checked to ensure that there are no required contacts annotated with the Element that remain. If any required element remains an exception is thrown.

ValidateText ( InputNode node, Schema schema ) : void

This validateText method validates the text value from the XML element node specified. This will check the class schema to determine if a Text annotation was used. If one was specified then the text within the XML element input node is checked to determine if it is a valid entry.

Write ( OutputNode node, Object source ) : void

This write method is used to perform serialization of the given source object. Serialization is performed by appending elements and attributes from the source object to the provided XML element object. How the objects contacts are serialized is determined by the XML schema class that the source object is an instance of. If a required contact is null an exception is thrown.

Write ( OutputNode node, Object source, Schema schema ) : void

This write method is used to perform serialization of the given source object. Serialization is performed by appending elements and attributes from the source object to the provided XML element object. How the objects contacts are serialized is determined by the XML schema class that the source object is an instance of. If a required contact is null an exception is thrown.

WriteAttribute ( OutputNode node, Object value, Label label ) : void

This write method is used to set the value of the provided object as an attribute to the XML element. This will acquire the string value of the object using toString only if the object provided is not an enumerated type. If the object is an enumerated type then the Enum.name method is used.

WriteAttributes ( OutputNode node, Object source, Schema schema ) : void

This write method is used to write all the attribute contacts from the provided source object to the XML element. This visits all the contacts marked with the Attribute annotation in the source object. All annotated contacts are written as attributes to the XML element. This will throw an exception if a required contact within the source object is null.

WriteElement ( OutputNode node, Object value, Converter convert ) : void

This is used write the element specified using the specified converter. Writing the value using the specified converter will result in the node being populated with the elements, attributes, and text values to the provided node. If there is a problem writing the value using the converter an exception is thrown.

WriteElement ( OutputNode node, Object value, Label label ) : void

This write method is used to append the provided object as an element to the given XML element object. This will recursively write the contacts from the provided object as elements. This is done using the Converter acquired from the contact label. If the type of the contact value is not of the same type as the XML schema class a "class" attribute is appended.

If the element being written is inline, then this will not check to see if there is a "class" attribute specifying the name of the class. This is because inline elements do not have an outer class and thus could never have an override.

WriteElements ( OutputNode node, Object source, Schema schema ) : void

This write method is used to write all the element contacts from the provided source object to the XML element. This visits all the contacts marked with the Element annotation in the source object. All annotated contacts are written as children to the XML element. This will throw an exception if a required contact within the source object is null.

WriteNamespaces ( OutputNode node, Class type, Label label ) : void

This is used to apply Decorator objects to the provided node before it is written. Application of decorations before the node is written allows namespaces and comments to be applied to the node. Decorations such as this do not affect the overall structure of the XML that is written.

WriteReplace ( Object source ) : Object

The replace method is used to replace an object before it is serialized. This is used so that an object can give a substitute to be written to the XML document in the event that the actual object is not suitable or desired for serialization. This acts as an equivalent to the Java Object Serialization writeReplace method for the object serialization.

WriteText ( OutputNode node, Object value, Label label ) : void

This write method is used to set the value of the provided object as the text for the XML element. This will acquire the string value of the object using toString only if the object provided is not an enumerated type. If the object is an enumerated type then the Enum.name method is used.

WriteText ( OutputNode node, Object source, Schema schema ) : void

This write method is used to write the text contact from the provided source object to the XML element. This takes the text value from the source object and writes it to the single contact marked with the Text annotation. If the value is null and the contact value is required an exception is thrown.

WriteVersion ( OutputNode node, Object source, Schema schema ) : void

This method is used to write the version attribute. A version is written only if it is not the initial version or if it required. The version is used to determine how to deserialize the XML. If the version is different from the expected version then it allows the object to be deserialized in a manner that does not require any attributes or elements, and unmatched nodes are ignored.

Method Details

Composite() public méthode

Constructor for the Composite object. This creates a converter object capable of serializing and deserializing root objects labeled with XML annotations. The XML schema class must be given to the instance in order to perform deserialization.
public Composite ( Context context, Type type ) : SimpleFramework.Xml.Strategy
context Context /// the source object used to perform serialization ///
type System.Type /// this is the XML schema type to use for this ///
Résultat SimpleFramework.Xml.Strategy

IsOverridden() public méthode

This is used to determine whether the specified value has been overridden by the strategy. If the item has been overridden then no more serialization is require for that value, this is effectively telling the serialization process to stop writing.
public IsOverridden ( OutputNode node, Object value, Type type ) : bool
node OutputNode /// the node that a potential override is written to ///
value Object /// this is the object instance to be serialized ///
type System.Type /// this is the type of the object to be serialized ///
Résultat bool

Read() public méthode

This read method performs deserialization of the XML schema class type by traversing the contacts and instantiating them using details from the provided XML element. Because this will convert a non-primitive value it delegates to other converters to perform deserialization of lists and primitives.

If any of the required contacts are not present within the provided XML element this will terminate deserialization and throw an exception. The annotation missing is reported in the exception.

public Read ( InputNode node ) : Object
node InputNode /// the XML element contact values are deserialized from ///
Résultat Object

Read() public méthode

This read method performs deserialization of the XML schema class type by traversing the contacts and instantiating them using details from the provided XML element. Because this will convert a non-primitive value it delegates to other converters to perform deserialization of lists and primitives.

If any of the required contacts are not present within the provided XML element this will terminate deserialization and throw an exception. The annotation missing is reported in the exception.

public Read ( InputNode node, Instance value, Class real ) : Object
node InputNode /// the XML element contact values are deserialized from ///
value Instance /// this is the instance for the object within the graph ///
real Class /// this is the real type that is to be evaluated ///
Résultat Object

Read() public méthode

This read method performs deserialization of the XML schema class type by traversing the contacts and instantiating them using details from the provided XML element. Because this will convert a non-primitive value it delegates to other converters to perform deserialization of lists and primitives.

If any of the required contacts are not present within the provided XML element this will terminate deserialization and throw an exception. The annotation missing is reported in the exception.

public Read ( InputNode node, Object source ) : Object
node InputNode /// the XML element contact values are deserialized from ///
source Object /// the object whose contacts are to be deserialized ///
Résultat Object

Read() public méthode

This read method is used to perform deserialization of the provided node object using a delegate converter. This is typically another Composite converter, or if the node is an attribute a Primitive converter. When the delegate converter has completed the deserialized value is assigned to the contact.
public Read ( InputNode node, Object source, Label label ) : Object
node InputNode /// this is the node that contains the contact value ///
source Object /// the type of the object that is being deserialized ///
label Label /// this is the label used to create the converter ///
Résultat Object

Read() public méthode

This read method performs deserialization of the XML schema class type by traversing the contacts and instantiating them using details from the provided XML element. Because this will convert a non-primitive value it delegates to other converters to perform deserialization of lists and primitives.

If any of the required contacts are not present within the provided XML element this will terminate deserialization and throw an exception. The annotation missing is reported in the exception.

public Read ( InputNode node, Schema schema, Instance value ) : Object
node InputNode /// the XML element contact values are deserialized from ///
schema Schema /// this is the schema for the class to be deserialized ///
value Instance /// this is the value used for the deserialization ///
Résultat Object

Read() public méthode

This read method performs deserialization of the XML schema class type by traversing the contacts and instantiating them using details from the provided XML element. Because this will convert a non-primitive value it delegates to other converters to perform deserialization of lists and primitives.

If any of the required contacts are not present within the provided XML element this will terminate deserialization and throw an exception. The annotation missing is reported in the exception.

public Read ( InputNode node, Object source, Schema schema ) : void
node InputNode /// the XML element contact values are deserialized from ///
source Object /// this type of the object that is to be deserialized ///
schema Schema /// this object visits the objects contacts ///
Résultat void

ReadAttribute() public méthode

This readAttribute method is used for deserialization of the provided node object using a delegate converter. This is typically another Composite converter, or if the node is an attribute a Primitive converter. When the delegate converter has completed the deserialized value is assigned to the contact.
public ReadAttribute ( InputNode node, Object source, LabelMap map ) : void
node InputNode /// this is the node that contains the contact value ///
source Object /// the type of the object that is being deserialized ///
map LabelMap /// this is the map that contains the label objects ///
Résultat void

ReadAttributes() public méthode

This readAttributes method reads the attributes from the provided XML element. This will iterate over all attributes within the element and convert those attributes as primitives to contact values within the source object.

Once all attributes within the XML element have been evaluated the Schema is checked to ensure that there are no required contacts annotated with the Attribute that remain. If any required attribute remains an exception is thrown.

public ReadAttributes ( InputNode node, Object source, Schema schema ) : void
node InputNode /// this is the XML element to be evaluated ///
source Object /// the type of the object that is being deserialized ///
schema Schema /// this is used to visit the attribute contacts ///
Résultat void

ReadConstructor() public méthode

This readConstructor method performs deserialization of the XML schema class type by traversing the contacts and creating them using details from the provided XML element. Because this will convert a non-primitive value it delegates to other converters to perform deserialization of lists and primitives.

This takes the approach of reading the XML elements and attributes before instantiating the object. Instantiation is performed using a declared constructor. The parameters for the constructor are taken from the deserialized objects.

public ReadConstructor ( InputNode node, Schema schema, Instance value ) : Object
node InputNode /// the XML element contact values are deserialized from ///
schema Schema /// this is the schema for the class to be deserialized ///
value Instance /// this is the value used for the deserialization ///
Résultat Object

ReadDefault() public méthode

This readDefault method performs deserialization of the XM schema class type by traversing the contacts and instantiating them using details from the provided XML element. Because this will convert a non-primitive value it delegates to other converters to perform deserialization of lists and primitives.

This takes the approach that the object is instantiated first and then the annotated fields and methods are deserialized from the XML elements and attributes. When all the details have be deserialized they are set on the internal contacts of the object.

public ReadDefault ( InputNode node, Schema schema, Instance value ) : Object
node InputNode /// the XML element contact values are deserialized from ///
schema Schema /// this is the schema for the class to be deserialized ///
value Instance /// this is the value used for the deserialization ///
Résultat Object

ReadElement() public méthode

This readElement method is used for deserialization of the provided node object using a delegate converter. This is typically another Composite converter, or if the node is an attribute a Primitive converter. When the delegate converter has completed the deserialized value is assigned to the contact.
public ReadElement ( InputNode node, Object source, LabelMap map ) : void
node InputNode /// this is the node that contains the contact value ///
source Object /// the type of the object that is being deserialized ///
map LabelMap /// this is the map that contains the label objects ///
Résultat void

ReadElements() public méthode

This readElements method reads the elements from the provided XML element. This will iterate over all elements within the element and convert those elements to primitives or composite objects depending on the contact annotation.

Once all elements within the XML element have been evaluated the Schema is checked to ensure that there are no required contacts annotated with the Element that remain. If any required element remains an exception is thrown.

public ReadElements ( InputNode node, Object source, Schema schema ) : void
node InputNode /// this is the XML element to be evaluated ///
source Object /// the type of the object that is being deserialized ///
schema Schema /// this is used to visit the element contacts ///
Résultat void

ReadObject() public méthode

This readObject method is used to perform the deserialization of the XML in to any original value. If there is no original value then this will do a read and instantiate a new value to deserialize in to. Reading in to the original ensures that existing lists or maps can be read in to.
public ReadObject ( InputNode node, Object source, Label label ) : Object
node InputNode /// this is the node that contains the contact value ///
source Object /// the source object to assign the contact value to ///
label Label /// this is the label used to create the converter ///
Résultat Object

ReadPrimitive() public méthode

This readPrimitive method will extract the text value from the node and replace any template variables before converting it to a primitive value. This uses a Primitive object to convert the node text to the resulting string. This will also respect all references on the node so cycle can be followed.
public ReadPrimitive ( InputNode node, Instance value ) : Object
node InputNode /// this is the node to be converted to a primitive ///
value Instance /// this is the type for the object within the graph ///
Résultat Object

ReadResolve() public méthode

The readResolve method is used to determine if there is a resolution method which can be used to substitute the object deserialized. The resolve method is used when an object wishes to provide a substitute within the deserialized object graph. This acts as an equivalent to the Java Object Serialization readResolve method for the object deserialization.
public ReadResolve ( InputNode node, Object source, Caller caller ) : Object
node InputNode /// the XML element object provided as a replacement ///
source Object /// the type of the object that is being deserialized ///
caller Caller /// this is used to invoke the callback methods ///
Résultat Object

ReadText() public méthode

This readText method is used to read the text value from the XML element node specified. This will check the class schema to determine if a Text annotation was specified. If one was specified then the text within the XML element input node is used to populate the contact value.
public ReadText ( InputNode node, Object source, Schema schema ) : void
node InputNode /// this is the XML element to acquire the text from ///
source Object /// the type of the object that is being deserialized ///
schema Schema /// this is used to visit the element contacts ///
Résultat void

ReadVersion() public méthode

This method is used to read the version from the provided input node. Once the version has been read it is used to determine how to deserialize the object. If the version is not the initial version then it is read in a manner that ignores excessive XML elements and attributes. Also none of the annotated fields or methods are required if the version is not the initial version.
public ReadVersion ( InputNode node, Object source, Label label ) : void
node InputNode /// the XML element contact values are deserialized from ///
source Object /// the type of the object that is being deserialized ///
label Label /// this is the label used to read the version attribute ///
Résultat void

ReadVersion() public méthode

This method is used to read the version from the provided input node. Once the version has been read it is used to determine how to deserialize the object. If the version is not the initial version then it is read in a manner that ignores excessive XML elements and attributes. Also none of the annotated fields or methods are required if the version is not the initial version.
public ReadVersion ( InputNode node, Object source, Schema schema ) : void
node InputNode /// the XML element contact values are deserialized from ///
source Object /// this object whose contacts are to be deserialized ///
schema Schema /// this object visits the objects contacts ///
Résultat void

Validate() public méthode

This validate method performs validation of the XML schema class type by traversing the contacts and validating them using details from the provided XML element. Because this will validate a non-primitive value it delegates to other converters to perform validation of lists, maps, and primitives.

If any of the required contacts are not present within the given XML element this will terminate validation and throw an exception The annotation missing is reported in the exception.

public Validate ( InputNode node ) : bool
node InputNode /// the XML element contact values are validated from ///
Résultat bool

Validate() public méthode

This validate method performs validation of the XML schema class type by traversing the contacts and validating them using details from the provided XML element. Because this will validate a non-primitive value it delegates to other converters to perform validation of lists, maps, and primitives.

If any of the required contacts are not present within the given XML element this will terminate validation and throw an exception The annotation missing is reported in the exception.

public Validate ( InputNode node, Class type ) : bool
node InputNode /// the XML element contact values are validated from ///
type Class /// this is the type to validate against the input node ///
Résultat bool

Validate() public méthode

This validate method is used to perform validation of the provided node object using a delegate converter. This is typically another Composite converter, or if the node is an attribute a Primitive converter. If this fails validation then an exception is thrown to report the issue.
public Validate ( InputNode node, Label label ) : void
node InputNode /// this is the node that contains the contact value ///
label Label /// this is the label used to create the converter ///
Résultat void

Validate() public méthode

This method checks to see if there are any Label objects remaining in the provided map that are required. This is used when validation is performed to ensure the the XML element validated contains sufficient details to satisfy the XML schema class annotations. If there is a required label that remains it is reported within the exception thrown.
public Validate ( InputNode node, LabelMap map ) : void
node InputNode /// this is the node that contains the composite data ///
map LabelMap /// this contains the converters to perform validation ///
Résultat void

Validate() public méthode

This method checks to see if there are any Label objects remaining in the provided map that are required. This is used when deserialization is performed to ensure the the XML element deserialized contains sufficient details to satisfy the XML schema class annotations. If there is a required label that remains it is reported within the exception thrown.
public Validate ( InputNode node, LabelMap map, Object source ) : void
node InputNode
map LabelMap /// this is the map to check for remaining labels ///
source Object /// this is the object that has been deserialized ///
Résultat void

ValidateAttribute() public méthode

This validateAttribute method performs a validation of the provided node object using a delegate converter. This is typically another Composite converter, or if the node is an attribute a Primitive converter. If this fails validation then an exception is thrown to report the issue.
public ValidateAttribute ( InputNode node, LabelMap map ) : void
node InputNode /// this is the node that contains the contact value ///
map LabelMap /// this is the map that contains the label objects ///
Résultat void

ValidateAttributes() public méthode

This validateAttributes method validates the attributes from the provided XML element. This will iterate over all attributes within the element and validate those attributes as primitives to contact values within the source object.

Once all attributes within the XML element have been evaluated the Schema is checked to ensure that there are no required contacts annotated with the Attribute that remain. If any required attribute remains an exception is thrown.

public ValidateAttributes ( InputNode node, Schema schema ) : void
node InputNode /// this is the XML element to be validated ///
schema Schema /// this is used to visit the attribute contacts ///
Résultat void

ValidateElement() public méthode

This validateElement method performs a validation of the provided node object using a delegate converter. This is typically another Composite converter, or if the node is an attribute a Primitive converter. If this fails validation then an exception is thrown to report the issue.
public ValidateElement ( InputNode node, LabelMap map ) : void
node InputNode /// this is the node that contains the contact value ///
map LabelMap /// this is the map that contains the label objects ///
Résultat void

ValidateElements() public méthode

This validateElements method validates the elements from the provided XML element. This will iterate over all elements within the element and validate those elements as primitives or composite objects depending on the contact annotation.

Once all elements within the XML element have been evaluated the Schema is checked to ensure that there are no required contacts annotated with the Element that remain. If any required element remains an exception is thrown.

public ValidateElements ( InputNode node, Schema schema ) : void
node InputNode /// this is the XML element to be evaluated ///
schema Schema /// this is used to visit the element contacts ///
Résultat void

ValidateText() public méthode

This validateText method validates the text value from the XML element node specified. This will check the class schema to determine if a Text annotation was used. If one was specified then the text within the XML element input node is checked to determine if it is a valid entry.
public ValidateText ( InputNode node, Schema schema ) : void
node InputNode /// this is the XML element to acquire the text from ///
schema Schema /// this is used to visit the element contacts ///
Résultat void

Write() public méthode

This write method is used to perform serialization of the given source object. Serialization is performed by appending elements and attributes from the source object to the provided XML element object. How the objects contacts are serialized is determined by the XML schema class that the source object is an instance of. If a required contact is null an exception is thrown.
public Write ( OutputNode node, Object source ) : void
node OutputNode /// the XML element the object is to be serialized to ///
source Object /// this is the source object to be serialized ///
Résultat void

Write() public méthode

This write method is used to perform serialization of the given source object. Serialization is performed by appending elements and attributes from the source object to the provided XML element object. How the objects contacts are serialized is determined by the XML schema class that the source object is an instance of. If a required contact is null an exception is thrown.
public Write ( OutputNode node, Object source, Schema schema ) : void
node OutputNode /// the XML element the object is to be serialized to ///
source Object /// this is the source object to be serialized ///
schema Schema /// this is used to track the referenced contacts ///
Résultat void

WriteAttribute() public méthode

This write method is used to set the value of the provided object as an attribute to the XML element. This will acquire the string value of the object using toString only if the object provided is not an enumerated type. If the object is an enumerated type then the Enum.name method is used.
public WriteAttribute ( OutputNode node, Object value, Label label ) : void
node OutputNode /// this is the XML element to write the attribute to ///
value Object /// this is the value to be set as an attribute ///
label Label /// the label that contains the contact details ///
Résultat void

WriteAttributes() public méthode

This write method is used to write all the attribute contacts from the provided source object to the XML element. This visits all the contacts marked with the Attribute annotation in the source object. All annotated contacts are written as attributes to the XML element. This will throw an exception if a required contact within the source object is null.
public WriteAttributes ( OutputNode node, Object source, Schema schema ) : void
node OutputNode /// this is the XML element to write attributes to ///
source Object /// this is the source object to be serialized ///
schema Schema /// this is used to track the referenced attributes ///
Résultat void

WriteElement() public méthode

This is used write the element specified using the specified converter. Writing the value using the specified converter will result in the node being populated with the elements, attributes, and text values to the provided node. If there is a problem writing the value using the converter an exception is thrown.
public WriteElement ( OutputNode node, Object value, Converter convert ) : void
node OutputNode /// this is the node that the value is to be written to ///
value Object /// this is the value that is to be written ///
convert Converter /// this is the converter used to perform writing ///
Résultat void

WriteElement() public méthode

This write method is used to append the provided object as an element to the given XML element object. This will recursively write the contacts from the provided object as elements. This is done using the Converter acquired from the contact label. If the type of the contact value is not of the same type as the XML schema class a "class" attribute is appended.

If the element being written is inline, then this will not check to see if there is a "class" attribute specifying the name of the class. This is because inline elements do not have an outer class and thus could never have an override.

public WriteElement ( OutputNode node, Object value, Label label ) : void
node OutputNode /// this is the XML element to write the element to ///
value Object /// this is the value to be set as an element ///
label Label /// the label that contains the contact details ///
Résultat void

WriteElements() public méthode

This write method is used to write all the element contacts from the provided source object to the XML element. This visits all the contacts marked with the Element annotation in the source object. All annotated contacts are written as children to the XML element. This will throw an exception if a required contact within the source object is null.
public WriteElements ( OutputNode node, Object source, Schema schema ) : void
node OutputNode /// this is the XML element to write elements to ///
source Object /// this is the source object to be serialized ///
schema Schema /// this is used to track the referenced elements ///
Résultat void

WriteNamespaces() public méthode

This is used to apply Decorator objects to the provided node before it is written. Application of decorations before the node is written allows namespaces and comments to be applied to the node. Decorations such as this do not affect the overall structure of the XML that is written.
public WriteNamespaces ( OutputNode node, Class type, Label label ) : void
node OutputNode /// this is the node that decorations are applied to ///
type Class /// this is the type to acquire the decoration for ///
label Label /// this contains the primary decorator to be used ///
Résultat void

WriteReplace() public méthode

The replace method is used to replace an object before it is serialized. This is used so that an object can give a substitute to be written to the XML document in the event that the actual object is not suitable or desired for serialization. This acts as an equivalent to the Java Object Serialization writeReplace method for the object serialization.
public WriteReplace ( Object source ) : Object
source Object /// this is the source object that is to be replaced ///
Résultat Object

WriteText() public méthode

This write method is used to set the value of the provided object as the text for the XML element. This will acquire the string value of the object using toString only if the object provided is not an enumerated type. If the object is an enumerated type then the Enum.name method is used.
public WriteText ( OutputNode node, Object value, Label label ) : void
node OutputNode /// this is the XML element to write the text value to ///
value Object /// this is the value to set as the XML element text ///
label Label /// the label that contains the contact details ///
Résultat void

WriteText() public méthode

This write method is used to write the text contact from the provided source object to the XML element. This takes the text value from the source object and writes it to the single contact marked with the Text annotation. If the value is null and the contact value is required an exception is thrown.
public WriteText ( OutputNode node, Object source, Schema schema ) : void
node OutputNode /// this is the XML element to write text value to ///
source Object /// this is the source object to be serialized ///
schema Schema /// this is used to track the referenced elements ///
Résultat void

WriteVersion() public méthode

This method is used to write the version attribute. A version is written only if it is not the initial version or if it required. The version is used to determine how to deserialize the XML. If the version is different from the expected version then it allows the object to be deserialized in a manner that does not require any attributes or elements, and unmatched nodes are ignored.
public WriteVersion ( OutputNode node, Object source, Schema schema ) : void
node OutputNode /// this is the node to read the version attribute from ///
source Object /// this is the source object that is to be written ///
schema Schema /// this is the schema that contains the version ///
Résultat void