C# Класс 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.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Описание методов

Builder() публичный Метод

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 ///
Результат System.Collections.Generic

GetInstance() публичный Метод

public GetInstance ( Criteria criteria ) : Object
criteria Criteria /// this contains the criteria to be used ///
Результат Object

GetInstance() публичный Метод

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 ///
Результат Object

GetParameter() публичный Метод

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 ///
Результат Parameter

IsDefault() публичный Метод

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
Результат bool

Score() публичный Метод

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 ///
Результат int

ToString() публичный Метод

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
Результат String