C# Class SimpleFramework.Xml.Core.PrimitiveArray

The PrimitiveArray object is used to convert a list of elements to an array of object entries. This in effect performs a serialization and deserialization of primitive elements for the array object. On serialization each primitive type must be checked against the array component type so that it is serialized in a form that can be deserialized dynamically. <array> <entry>example text one</entry> <entry>example text two</entry> <entry>example text three</entry> </array> For the above XML element list the element entry is contained within the array. Each entry element is deserialized as a from a parent XML element, which is specified in the annotation. For serialization the reverse is done, each element taken from the array is written into an element created from the parent element.
Inheritance: Converter
显示文件 Open project: ngallagher/simplexml

Public Methods

Method Description
IsOverridden ( OutputNode node, Object value ) : 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.

PrimitiveArray ( Context context, Type type, Type entry, String parent ) : SimpleFramework.Xml.Strategy

Constructor for the PrimitiveArray object. This is given the array type for the contact that is to be converted. An array of the specified type is used to hold the deserialized elements and will be the same length as the number of elements.

Read ( InputNode node ) : Object

This read method will read the XML element list from the provided node and deserialize its children as entry types. This will deserialize each entry type as a primitive value. In order to do this the parent string provided forms the element.

Read ( InputNode node, Object list ) : Object

This read method will read the XML element list from the provided node and deserialize its children as entry types. This will deserialize each entry type as a primitive value. In order to do this the parent string provided forms the element.

Validate ( InputNode node ) : bool

This validate method will validate the XML element list from the provided node and validate its children as entry types. This will validate each entry type as a primitive value. In order to do this the parent string provided forms the element.

Validate ( InputNode node, Class type ) : bool

This validate method wll validate the XML element list from the provided node and validate its children as entry types. This will validate each entry type as a primitive value. In order to do this the parent string provided forms the element.

Write ( OutputNode node, Object source ) : void

This write method will write the specified object to the given XML element as as array entries. Each entry within the given array must be assignable to the array component type. This will deserialize each entry type as a primitive value. In order to do this the parent string provided forms the element.

Write ( OutputNode node, Object source, int index ) : void

This write method will write the specified object to the given XML element as as array entries. Each entry within the given array must be assignable to the array component type. This will deserialize each entry type as a primitive value. In order to do this the parent string provided forms the element.

Method Details

IsOverridden() public method

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 ) : bool
node OutputNode /// the node that a potential override is written to ///
value Object /// this is the object instance to be serialized ///
return bool

PrimitiveArray() public method

Constructor for the PrimitiveArray object. This is given the array type for the contact that is to be converted. An array of the specified type is used to hold the deserialized elements and will be the same length as the number of elements.
public PrimitiveArray ( Context context, Type type, Type entry, String parent ) : SimpleFramework.Xml.Strategy
context Context /// this is the context object used for serialization ///
type System.Type /// this is the actual field type from the schema ///
entry System.Type /// the entry type to be stored within the array ///
parent String /// this is the name to wrap the array element with ///
return SimpleFramework.Xml.Strategy

Read() public method

This read method will read the XML element list from the provided node and deserialize its children as entry types. This will deserialize each entry type as a primitive value. In order to do this the parent string provided forms the element.
public Read ( InputNode node ) : Object
node InputNode /// this is the XML element that is to be deserialized ///
return Object

Read() public method

This read method will read the XML element list from the provided node and deserialize its children as entry types. This will deserialize each entry type as a primitive value. In order to do this the parent string provided forms the element.
public Read ( InputNode node, Object list ) : Object
node InputNode /// this is the XML element that is to be deserialized ///
list Object /// this is the array to read the array values in to ///
return Object

Validate() public method

This validate method will validate the XML element list from the provided node and validate its children as entry types. This will validate each entry type as a primitive value. In order to do this the parent string provided forms the element.
public Validate ( InputNode node ) : bool
node InputNode /// this is the XML element that is to be validated ///
return bool

Validate() public method

This validate method wll validate the XML element list from the provided node and validate its children as entry types. This will validate each entry type as a primitive value. In order to do this the parent string provided forms the element.
public Validate ( InputNode node, Class type ) : bool
node InputNode /// this is the XML element that is to be validated ///
type Class /// this is the array type used to create the array ///
return bool

Write() public method

This write method will write the specified object to the given XML element as as array entries. Each entry within the given array must be assignable to the array component type. This will deserialize each entry type as a primitive value. In order to do this the parent string provided forms the element.
public Write ( OutputNode node, Object source ) : void
node OutputNode /// this is the XML element container to be populated ///
source Object /// this is the source object array to be serialized ///
return void

Write() public method

This write method will write the specified object to the given XML element as as array entries. Each entry within the given array must be assignable to the array component type. This will deserialize each entry type as a primitive value. In order to do this the parent string provided forms the element.
public Write ( OutputNode node, Object source, int index ) : void
node OutputNode /// this is the XML element container to be populated ///
source Object /// this is the source object array to be serialized ///
index int /// this is the position in the array to set the item ///
return void