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

The Factory object provides a base class for factories used to produce field values from XML elements. The goal of this type of factory is to make use of the Strategy object to determine the type of the field value. The strategy class must be assignable to the field class type, that is, it must extend it or implement it if it represents an interface. If the strategy returns a null Value then the subclass implementation determines the type used to populate the object field value.
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
context Context
support Support
type System.Type

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

Метод Описание
GetConversion ( InputNode node ) : Value

This performs the conversion from the element node to a type. This is where the Strategy object is consulted and asked for a class that will represent the provided XML element. This will, depending on the strategy implementation, make use of attributes and/or elements to determine the type for the field.

GetOverride ( InputNode node ) : Value
IsCompatible ( Class expect, Class type ) : bool

This is used to determine whether the provided base class can be assigned from the issued type. For an override to be compatible with the field type an instance of the override type must be assignable to the field value.

IsInstantiable ( Class type ) : bool

This is used to determine whether the type given is instantiable, that is, this determines if an instance of that type can be created. If the type is an interface or an abstract class then this will return false.

SetOverride ( Type type, Object value, OutputNode node ) : bool

This method is used to set the override class within an element. This delegates to the Strategy implementation, which depending on the implementation may add an attribute of a child element to describe the type of the object provided to this.

Защищенные методы

Метод Описание
Factory ( Context context, Type type ) : SimpleFramework.Xml.Strategy

Constructor for the Factory object. This is given the class type for the field that this factory will determine the actual type for. The actual type must be assignable to the field type to insure that any instance can be set.

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

Factory() защищенный Метод

Constructor for the Factory object. This is given the class type for the field that this factory will determine the actual type for. The actual type must be assignable to the field type to insure that any instance can be set.
protected Factory ( Context context, Type type ) : SimpleFramework.Xml.Strategy
context Context /// the contextual object used by the persister ///
type System.Type /// this is the property representing the field ///
Результат SimpleFramework.Xml.Strategy

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

This performs the conversion from the element node to a type. This is where the Strategy object is consulted and asked for a class that will represent the provided XML element. This will, depending on the strategy implementation, make use of attributes and/or elements to determine the type for the field.
public GetConversion ( InputNode node ) : Value
node InputNode /// this is the element used to extract the override ///
Результат Value

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

public GetOverride ( InputNode node ) : Value
node InputNode /// this is the node used to search for the override ///
Результат Value

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

This is used to determine whether the provided base class can be assigned from the issued type. For an override to be compatible with the field type an instance of the override type must be assignable to the field value.
public IsCompatible ( Class expect, Class type ) : bool
expect Class /// this is the field value present the the object ///
type Class /// this is the specialized type that will be assigned ///
Результат bool

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

This is used to determine whether the type given is instantiable, that is, this determines if an instance of that type can be created. If the type is an interface or an abstract class then this will return false.
public IsInstantiable ( Class type ) : bool
type Class /// this is the type to check the modifiers of ///
Результат bool

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

This method is used to set the override class within an element. This delegates to the Strategy implementation, which depending on the implementation may add an attribute of a child element to describe the type of the object provided to this.
public SetOverride ( Type type, Object value, OutputNode node ) : bool
type System.Type /// this is the class of the field type being serialized ///
value Object
node OutputNode /// the XML element that is to be given the details ///
Результат bool

Описание свойств

context защищенное свойство

This is the context object used for the serialization process.
protected Context context
Результат Context

support защищенное свойство

This is used to translate all of the primitive type strings.
protected Support,SimpleFramework.Xml.Core support
Результат Support

type защищенное свойство

This is the field type that the class must be assignable to.
protected Type,System type
Результат System.Type