C# Class SimpleFramework.Xml.Core.ObjectInstance

The ObjectInstance is used to instantiate an object from the criteria provided in the given Value. If the value contains a reference then the reference is provided from this type. For performance the Context object is used to instantiate the object as it contains a reflection cache of constructors.
Inheritance: Instance
显示文件 Open project: ngallagher/simplexml

Public Methods

Method Description
GetInstance ( Class type ) : Object
IsReference ( ) : bool

This is used to determine if the type is a reference type. A reference type is a type that does not require any XML deserialization based on its annotations. Types that are references could be substitutes objects are existing ones.

ObjectInstance ( Context context, Value value ) : SimpleFramework.Xml.Strategy

Constructor for the ObjectInstance object. This is used to create an instance of the type described by the value object. If the value object contains a reference then this will simply provide that reference.

SetInstance ( Object Object ) : Object

This method is used acquire the value from the type and if possible replace the value for the type. If the value can not be replaced then an exception should be thrown. This is used to allow primitives to be inserted into a graph.

Method Details

GetInstance() public method

public GetInstance ( Class type ) : Object
type Class /// this is the type that is to be instantiated ///
return Object

IsReference() public method

This is used to determine if the type is a reference type. A reference type is a type that does not require any XML deserialization based on its annotations. Types that are references could be substitutes objects are existing ones.
public IsReference ( ) : bool
return bool

ObjectInstance() public method

Constructor for the ObjectInstance object. This is used to create an instance of the type described by the value object. If the value object contains a reference then this will simply provide that reference.
public ObjectInstance ( Context context, Value value ) : SimpleFramework.Xml.Strategy
context Context /// this is used to instantiate the object ///
value Value /// this is the value describing the instance ///
return SimpleFramework.Xml.Strategy

SetInstance() public method

This method is used acquire the value from the type and if possible replace the value for the type. If the value can not be replaced then an exception should be thrown. This is used to allow primitives to be inserted into a graph.
public SetInstance ( Object Object ) : Object
Object Object
return Object