C# Class SimpleFramework.Xml.Core.ArrayFactory

The ArrayFactory is used to create object array types that are compatible with the field type. This simply requires the type of the array in order to instantiate that array. However, this also performs a check on the field type to ensure that the array component types are compatible.
Inheritance: Factory
Mostrar archivo Open project: ngallagher/simplexml Class Usage Examples

Private Properties

Property Type Description

Public Methods

Method Description
ArrayFactory ( Context context, Type type ) : SimpleFramework.Xml.Strategy

Constructor for the ArrayFactory object. This is given the array component type as taken from the field type of the source object. Each request for an array will return an array which uses a compatible component type.

GetInstance ( InputNode node ) : Instance
GetInstance ( Value value, Class type ) : Instance

Creates the array type to use. This will use the provided XML element to determine the array type and provide a means for creating an array with the Value object. If the array types are not compatible an exception is thrown.

Method Details

ArrayFactory() public method

Constructor for the ArrayFactory object. This is given the array component type as taken from the field type of the source object. Each request for an array will return an array which uses a compatible component type.
public ArrayFactory ( Context context, Type type ) : SimpleFramework.Xml.Strategy
context Context /// this is the context object for serialization ///
type System.Type /// the array component type for the field object ///
return SimpleFramework.Xml.Strategy

GetInstance() public method

public GetInstance ( InputNode node ) : Instance
node InputNode /// this is the input node for the array element ///
return Instance

GetInstance() public method

Creates the array type to use. This will use the provided XML element to determine the array type and provide a means for creating an array with the Value object. If the array types are not compatible an exception is thrown.
public GetInstance ( Value value, Class type ) : Instance
value Value /// this is the type object with the array details ///
type Class /// this is the entry type for the array instance ///
return Instance