C# Class SimpleFramework.Xml.Core.Builder

The Builder object is used to represent an single constructor within an object. It contains the actual constructor as well as the list of parameters. Each builder will score its weight when given a Criteria object. This allows the deserialization process to find the most suitable one to use when instantiating an object.
ファイルを表示 Open project: ngallagher/simplexml Class Usage Examples

Public Methods

Method Description
Builder ( Constructor factory, Index index ) : System.Collections.Generic

Constructor for the Builder object. This is used to create a factory like object used for instantiating objects. Each builder will score its suitability using the parameters it is provided.

GetInstance ( Criteria criteria ) : Object
GetInstance ( Object list ) : Object

This is used to instantiate the object using a constructor that takes deserialized objects as arguments. The objects that have been deserialized are provided in declaration order so they can be passed to the constructor to instantiate the object.

GetParameter ( String name ) : Parameter

This is used to acquire the named Parameter from the builder. A parameter is taken from the constructor which contains annotations for each object that is required. These parameters must have a matching field or method.

IsDefault ( ) : bool

This is used to determine if this Builder is a default constructor. If the class does contain a no argument constructor then this will return true.

Score ( Criteria criteria ) : int

This is used to score this Builder object so that it can be weighed amongst other constructors. The builder that scores the highest is the one that is used for instantiation.

ToString ( ) : String

This is used to acquire a descriptive name for the builder. Providing a name is useful in debugging and when exceptions are thrown as it describes the constructor the builder represents.

Method Details

Builder() public method

Constructor for the Builder object. This is used to create a factory like object used for instantiating objects. Each builder will score its suitability using the parameters it is provided.
public Builder ( Constructor factory, Index index ) : System.Collections.Generic
factory Constructor /// this is the factory used for instantiation ///
index Index /// this is the map of parameters that are declared ///
return System.Collections.Generic

GetInstance() public method

public GetInstance ( Criteria criteria ) : Object
criteria Criteria /// this contains the criteria to be used ///
return Object

GetInstance() public method

This is used to instantiate the object using a constructor that takes deserialized objects as arguments. The objects that have been deserialized are provided in declaration order so they can be passed to the constructor to instantiate the object.
public GetInstance ( Object list ) : Object
list Object /// this is the list of objects used for instantiation ///
return Object

GetParameter() public method

This is used to acquire the named Parameter from the builder. A parameter is taken from the constructor which contains annotations for each object that is required. These parameters must have a matching field or method.
public GetParameter ( String name ) : Parameter
name String /// this is the name of the parameter to be acquired ///
return Parameter

IsDefault() public method

This is used to determine if this Builder is a default constructor. If the class does contain a no argument constructor then this will return true.
public IsDefault ( ) : bool
return bool

Score() public method

This is used to score this Builder object so that it can be weighed amongst other constructors. The builder that scores the highest is the one that is used for instantiation.
public Score ( Criteria criteria ) : int
criteria Criteria /// this contains the criteria to be used ///
return int

ToString() public method

This is used to acquire a descriptive name for the builder. Providing a name is useful in debugging and when exceptions are thrown as it describes the constructor the builder represents.
public ToString ( ) : String
return String