C# Класс SimpleFramework.Xml.Core.ConstructorScanner

The ConstructorScanner object is used to scan all all constructors that have XML annotations for their parameters. parameters. Each constructor scanned is converted in to a Builder object. In order to ensure consistency amongst the annotated parameters each named parameter must have the exact same type and annotation attributes across the constructors. This ensures a consistent XML representation.
Показать файл Открыть проект

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

Метод Описание
Build ( Constructor factory, Index map ) : void

This is used to build the Builder object that is to be used to instantiate the object. The builder contains the constructor at the parameters in the declaration order.

ConstructorScanner ( Class type ) : SimpleFramework.Xml

Constructor for the ConstructorScanner object. This is used to scan the specified class for constructors that can be used to instantiate the class. Only constructors that have all parameters annotated will be considered.

Create ( Constructor factory, Annotation label, int ordinal ) : Parameter

This is used to create a Parameter object which is used to represent a parameter to a constructor. Each parameter contains an annotation an the index it appears in.

IsInstantiable ( Class type ) : bool

This is used to determine if the class is an inner class. If the class is a inner class and not static then this returns false. Only static inner classes can be instantiated using reflection as they do not require a "this" argument.

Process ( Constructor factory, Annotation label, int ordinal ) : Parameter

This is used to create a Parameter object which is used to represent a parameter to a constructor. Each parameter contains an annotation an the index it appears in.

Scan ( Class type ) : void
Scan ( Constructor factory, Index map ) : void

This is used to scan the specified constructor for annotations that it contains. Each parameter annotation is evaluated and if it is an XML annotation it is considered to be a valid parameter and is added to the parameter map.

Validate ( Parameter parameter, String name ) : void

This is used to validate the parameter against all the other parameters for the class. Validating each of the parameters ensures that the annotations for the parameters remain consistent throughout the class.

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

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

This is used to build the Builder object that is to be used to instantiate the object. The builder contains the constructor at the parameters in the declaration order.
public Build ( Constructor factory, Index map ) : void
factory Constructor /// this is the constructor that is to be scanned ///
map Index /// this is the parameter map that contains parameters ///
Результат void

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

Constructor for the ConstructorScanner object. This is used to scan the specified class for constructors that can be used to instantiate the class. Only constructors that have all parameters annotated will be considered.
public ConstructorScanner ( Class type ) : SimpleFramework.Xml
type Class /// this is the type that is to be scanned ///
Результат SimpleFramework.Xml

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

This is used to create a Parameter object which is used to represent a parameter to a constructor. Each parameter contains an annotation an the index it appears in.
public Create ( Constructor factory, Annotation label, int ordinal ) : Parameter
factory Constructor /// this is the constructor the parameter is in ///
label Annotation /// this is the annotation used for the parameter ///
ordinal int /// this is the position the parameter appears at ///
Результат Parameter

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

This is used to determine if the class is an inner class. If the class is a inner class and not static then this returns false. Only static inner classes can be instantiated using reflection as they do not require a "this" argument.
public IsInstantiable ( Class type ) : bool
type Class /// this is the class that is to be evaluated ///
Результат bool

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

This is used to create a Parameter object which is used to represent a parameter to a constructor. Each parameter contains an annotation an the index it appears in.
public Process ( Constructor factory, Annotation label, int ordinal ) : Parameter
factory Constructor /// this is the constructor the parameter is in ///
label Annotation /// this is the annotation used for the parameter ///
ordinal int /// this is the position the parameter appears at ///
Результат Parameter

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

public Scan ( Class type ) : void
type Class /// this is the type that is to be scanned ///
Результат void

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

This is used to scan the specified constructor for annotations that it contains. Each parameter annotation is evaluated and if it is an XML annotation it is considered to be a valid parameter and is added to the parameter map.
public Scan ( Constructor factory, Index map ) : void
factory Constructor /// this is the constructor that is to be scanned ///
map Index /// this is the parameter map that contains parameters ///
Результат void

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

This is used to validate the parameter against all the other parameters for the class. Validating each of the parameters ensures that the annotations for the parameters remain consistent throughout the class.
public Validate ( Parameter parameter, String name ) : void
parameter Parameter /// this is the parameter to be validated ///
name String /// this is the name of the parameter to validate ///
Результат void