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.
Afficher le fichier Open project: ngallagher/simplexml Class Usage Examples

Méthodes publiques

Méthode 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 méthode

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 ///
Résultat System.Collections.Generic

GetInstance() public méthode

public GetInstance ( Criteria criteria ) : Object
criteria Criteria /// this contains the criteria to be used ///
Résultat Object

GetInstance() public méthode

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 ///
Résultat Object

GetParameter() public méthode

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 ///
Résultat Parameter

IsDefault() public méthode

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
Résultat bool

Score() public méthode

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 ///
Résultat int

ToString() public méthode

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
Résultat String