C# Class SimpleFramework.Xml.Util.ConverterFactory

The ConverterFactory is used to instantiate objects based on a provided type or annotation. This provides a single point of creation for all converters within the framework. For performance all the instantiated converters are cached against the class for that converter. This ensures the converters can be acquired without the overhead of instantiation.
Show file Open project: ngallagher/simplexml Class Usage Examples

Public Methods

Method Description
ConverterFactory ( ) : System

Constructor for the ConverterFactory object. This will create an internal cache which is used to cache all instantiations made by the factory. Caching the converters ensures there is no overhead with instantiations.

GetConstructor ( Class type ) : Constructor

This is used to acquire the default no argument constructor for the the provided type. If the constructor is not accessible then it will be made accessible so that it can be instantiated.

GetConverter ( Class type ) : Converter

This is used to instantiate the converter based on the type provided. If the type provided can not be instantiated for some reason then an exception is thrown from this method.

GetConverter ( Class type, Constructor factory ) : Converter

This is used to instantiate the converter based on the type provided. If the type provided can not be instantiated for some reason then an exception is thrown from this method.

GetInstance ( Class type ) : Converter

This is used to instantiate the converter based on the type provided. If the type provided can not be instantiated for some reason then an exception is thrown from this method.

GetInstance ( Convert convert ) : Converter

This is used to instantiate the converter based on the type of the Convert annotation provided. If the type can not be instantiated for some reason then an exception is thrown from this method.

Method Details

ConverterFactory() public method

Constructor for the ConverterFactory object. This will create an internal cache which is used to cache all instantiations made by the factory. Caching the converters ensures there is no overhead with instantiations.
public ConverterFactory ( ) : System
return System

GetConstructor() public method

This is used to acquire the default no argument constructor for the the provided type. If the constructor is not accessible then it will be made accessible so that it can be instantiated.
public GetConstructor ( Class type ) : Constructor
type Class /// this is the type to acquire the constructor for ///
return Constructor

GetConverter() public method

This is used to instantiate the converter based on the type provided. If the type provided can not be instantiated for some reason then an exception is thrown from this method.
public GetConverter ( Class type ) : Converter
type Class /// this is the converter type to be instantiated ///
return Converter

GetConverter() public method

This is used to instantiate the converter based on the type provided. If the type provided can not be instantiated for some reason then an exception is thrown from this method.
public GetConverter ( Class type, Constructor factory ) : Converter
type Class /// this is the converter type to be instantiated ///
factory Constructor /// this is the constructor used to instantiate ///
return Converter

GetInstance() public method

This is used to instantiate the converter based on the type provided. If the type provided can not be instantiated for some reason then an exception is thrown from this method.
public GetInstance ( Class type ) : Converter
type Class /// this is the converter type to be instantiated ///
return Converter

GetInstance() public method

This is used to instantiate the converter based on the type of the Convert annotation provided. If the type can not be instantiated for some reason then an exception is thrown from this method.
public GetInstance ( Convert convert ) : Converter
convert Convert /// this is the annotation containing the type ///
return Converter