C# Class SimpleFramework.Xml.Util.ConverterScanner

The ConverterScanner is used to create a converter given a method or field representation. Creation of the converter is done using the Convert annotation, which may be used to annotate a field, method or class. This describes the implementation to use for object serialization. To account for polymorphism the type scanned for annotations can be overridden from type provided in the Type object. This ensures that if a collection of objects are serialized the correct implementation will be used for each type or subtype.
Show file Open project: ngallagher/simplexml Class Usage Examples

Public Methods

Method Description
ConverterScanner ( ) : SimpleFramework.Xml.Strategy

Constructor for the ConverterScanner object. This uses an internal factory to instantiate and cache all of the converters created. This will ensure that there is reduced overhead for a serialization process using converters.

GetConvert ( Type type ) : Convert

This method is used to scan the provided Type for an annotation. If the Type represents a field or method then the annotation can be taken directly from that field or method. If however the type represents a class then the class itself must contain the annotation.

GetConvert ( Type type, Class real ) : Convert

This method is used to scan the provided Type for an annotation. If the Type represents a field or method then the annotation can be taken directly from that field or method. If however the type represents a class then the class itself must contain the annotation.

GetConverter ( Type type, Object value ) : Converter

This method will lookup and instantiate a converter found from scanning the field or method type provided. If the type has been overridden then the object instance will provide the type to scan. If no annotation is found on the class, field or method then this will return null.

GetConverter ( Type type, Value value ) : Converter

This method will lookup and instantiate a converter found from scanning the field or method type provided. If the type has been overridden then the Value object will provide the type to scan. If no annotation is found on the class, field or method then this will return null.

Private Methods

Method Description
ConvertException ( ) : SimpleFramework.Xml.Strategy

Method Details

ConverterScanner() public method

Constructor for the ConverterScanner object. This uses an internal factory to instantiate and cache all of the converters created. This will ensure that there is reduced overhead for a serialization process using converters.
public ConverterScanner ( ) : SimpleFramework.Xml.Strategy
return SimpleFramework.Xml.Strategy

GetConvert() public method

This method is used to scan the provided Type for an annotation. If the Type represents a field or method then the annotation can be taken directly from that field or method. If however the type represents a class then the class itself must contain the annotation.
public GetConvert ( Type type ) : Convert
type System.Type /// the field or method containing the annotation ///
return Convert

GetConvert() public method

This method is used to scan the provided Type for an annotation. If the Type represents a field or method then the annotation can be taken directly from that field or method. If however the type represents a class then the class itself must contain the annotation.
public GetConvert ( Type type, Class real ) : Convert
type System.Type /// the field or method containing the annotation ///
real Class /// the type that represents the field or method ///
return Convert

GetConverter() public method

This method will lookup and instantiate a converter found from scanning the field or method type provided. If the type has been overridden then the object instance will provide the type to scan. If no annotation is found on the class, field or method then this will return null.
public GetConverter ( Type type, Object value ) : Converter
type System.Type /// this is the type to search for the annotation ///
value Object /// this contains the type if it was overridden ///
return Converter

GetConverter() public method

This method will lookup and instantiate a converter found from scanning the field or method type provided. If the type has been overridden then the Value object will provide the type to scan. If no annotation is found on the class, field or method then this will return null.
public GetConverter ( Type type, Value value ) : Converter
type System.Type /// this is the type to search for the annotation ///
value Value /// this contains the type if it was overridden ///
return Converter