C# Class SimpleFramework.Xml.Core.Persister

The Persister object is used to provide an implementation of a serializer. This : the Serializer interface and enables objects to be persisted and loaded from various sources. This implementation makes use of Filter objects to replace template variables within the source XML document. It is fully thread safe and can be shared by multiple threads without concerns.

Deserialization is performed by passing an XML schema class into one of the read methods along with the source of an XML stream. The read method then reads the contents of the XML stream and builds the object using annotations within the XML schema class.

Serialization is performed by passing an object and an XML stream into one of the write methods. The serialization process will use the class of the provided object as the schema class. The object is traversed and all fields are marshalled to the result stream.

Inheritance: Serializer
Mostra file Open project: ngallagher/simplexml Class Usage Examples

Public Methods

Method Description
Persister ( ) : SimpleFramework.Xml.Filter

Constructor for the Persister object. This is used to create a serializer object that will use an empty filter. This means that template variables will remain unchanged within the XML document parsed when an object is deserialized.

Persister ( Dictionary filter ) : SimpleFramework.Xml.Filter

Constructor for the Persister object. This is used to create a serializer object that will use a platform filter object using the overrides within the provided map. This means that template variables will be replaced firstly with mappings from within the provided map, followed by system properties.

Persister ( Dictionary filter, Format format ) : SimpleFramework.Xml.Filter

Constructor for the Persister object. This is used to create a serializer object that will use a platform filter object using the overrides within the provided map. This means that template variables will be replaced firstly with mappings from within the provided map, followed by system properties.

Persister ( Filter filter ) : SimpleFramework.Xml.Filter

Constructor for the Persister object. This is used to create a serializer object that will use the provided filter. This persister will replace all variables encountered when deserializing an object with mappings found in the filter.

Persister ( Filter filter, Format format ) : SimpleFramework.Xml.Filter

Constructor for the Persister object. This is used to create a serializer object that will use the provided filter. This persister will replace all variables encountered when deserializing an object with mappings found in the filter.

Persister ( Filter filter, Matcher matcher ) : SimpleFramework.Xml.Filter

Constructor for the Persister object. This is used to create a serializer object that will use the provided filter. This persister will replace all variables encountered when deserializing an object with mappings found in the filter.

Persister ( Filter filter, Matcher matcher, Format format ) : SimpleFramework.Xml.Filter

Constructor for the Persister object. This is used to create a serializer object that will use the provided filter. This persister will replace all variables encountered when deserializing an object with mappings found in the filter.

Persister ( Format format ) : SimpleFramework.Xml.Filter

Constructor for the Persister object. This is used to create a serializer object that will use the provided format instructions. The persister uses the Format object to structure the generated XML. It determines the indent size of the document and whether it should contain a prolog.

Persister ( Matcher matcher ) : SimpleFramework.Xml.Filter

Constructor for the Persister object. This is used to create a serializer object that will use the provided matcher for customizable transformations. The Matcher will enable the persister to determine the correct way to transform the types that are not annotated and considered primitives.

Persister ( Matcher matcher, Format format ) : SimpleFramework.Xml.Filter

Constructor for the Persister object. This is used to create a serializer object that will use the provided matcher for customizable transformations. The Matcher will enable the persister to determine the correct way to transform the types that are not annotated and considered primitives.

Persister ( Strategy strategy ) : SimpleFramework.Xml.Filter

Constructor for the Persister object. This is used to create a serializer object that will use a strategy object. This persister will use the provided Strategy to intercept the XML elements in order to read and write persistent data, such as the class name or version of the document.

Persister ( Strategy strategy, Dictionary data ) : SimpleFramework.Xml.Filter

Constructor for the Persister object. This is used to create a serializer object that will use a platform filter object using the overrides within the provided map. This means that template variables will be replaced firstly with mappings from within the provided map, followed by system properties.

This persister will use the provided Strategy to intercept the XML elements in order to read and write persistent data, such as the class name or version of the document.

Persister ( Strategy strategy, Dictionary data, Format format ) : SimpleFramework.Xml.Filter

Constructor for the Persister object. This is used to create a serializer object that will use the provided filter. This persister will replace all variables encountered when deserializing an object with mappings found in the filter.

This persister will use the provided Strategy to intercept the XML elements in order to read and write persistent data, such as the class name or version of the document.

Persister ( Strategy strategy, Filter filter ) : SimpleFramework.Xml.Filter

Constructor for the Persister object. This is used to create a serializer object that will use the provided filter. This persister will replace all variables encountered when deserializing an object with mappings found in the filter.

This persister will use the provided Strategy to intercept the XML elements in order to read and write persistent data, such as the class name or version of the document.

Persister ( Strategy strategy, Filter filter, Format format ) : SimpleFramework.Xml.Filter

Constructor for the Persister object. This is used to create a serializer object that will use the provided filter. This persister will replace all variables encountered when deserializing an object with mappings found in the filter.

This persister will use the provided Strategy to intercept the XML elements in order to read and write persistent data, such as the class name or version of the document.

Persister ( Strategy strategy, Filter filter, Matcher matcher ) : SimpleFramework.Xml.Filter

Constructor for the Persister object. This is used to create a serializer object that will use the provided matcher for customizable transformations. The Matcher will enable the persister to determine the correct way to transform the types that are not annotated and considered primitives.

This persister will use the provided Strategy to intercept the XML elements in order to read and write persistent data, such as the class name or version of the document.

Persister ( Strategy strategy, Filter filter, Matcher matcher, Format format ) : SimpleFramework.Xml.Filter

Constructor for the Persister object. This is used to create a serializer object that will use the provided matcher for customizable transformations. The Matcher will enable the persister to determine the correct way to transform the types that are not annotated and considered primitives.

This persister will use the provided Strategy to intercept the XML elements in order to read and write persistent data, such as the class name or version of the document.

Persister ( Strategy strategy, Format format ) : SimpleFramework.Xml.Filter

Constructor for the Persister object. This is used to create a serializer object that will use a strategy object. This persister will use the provided Strategy to intercept the XML elements in order to read and write persistent data, such as the class name or version of the document.

Persister ( Strategy strategy, Matcher matcher ) : SimpleFramework.Xml.Filter

Constructor for the Persister object. This is used to create a serializer object that will use the provided matcher for customizable transformations. The Matcher will enable the persister to determine the correct way to transform the types that are not annotated and considered primitives.

This persister will use the provided Strategy to intercept the XML elements in order to read and write persistent data, such as the class name or version of the document.

Persister ( Strategy strategy, Matcher matcher, Format format ) : SimpleFramework.Xml.Filter

Constructor for the Persister object. This is used to create a serializer object that will use the provided matcher for customizable transformations. The Matcher will enable the persister to determine the correct way to transform the types that are not annotated and considered primitives.

This persister will use the provided Strategy to intercept the XML elements in order to read and write persistent data, such as the class name or version of the document.

Private Methods

Method Description
Read ( type source ) : SimpleFramework.Xml.Filter
Read ( Class T ) : T

This read method will read the contents of the XML document from the provided source and convert it into an object of the specified type. If the XML source cannot be deserialized or there is a problem building the object graph an exception is thrown. The instance deserialized is returned.

Method Details

Persister() public method

Constructor for the Persister object. This is used to create a serializer object that will use an empty filter. This means that template variables will remain unchanged within the XML document parsed when an object is deserialized.
public Persister ( ) : SimpleFramework.Xml.Filter
return SimpleFramework.Xml.Filter

Persister() public method

Constructor for the Persister object. This is used to create a serializer object that will use a platform filter object using the overrides within the provided map. This means that template variables will be replaced firstly with mappings from within the provided map, followed by system properties.
public Persister ( Dictionary filter ) : SimpleFramework.Xml.Filter
filter Dictionary /// this is the map that contains the overrides ///
return SimpleFramework.Xml.Filter

Persister() public method

Constructor for the Persister object. This is used to create a serializer object that will use a platform filter object using the overrides within the provided map. This means that template variables will be replaced firstly with mappings from within the provided map, followed by system properties.
public Persister ( Dictionary filter, Format format ) : SimpleFramework.Xml.Filter
filter Dictionary /// this is the map that contains the overrides ///
format SimpleFramework.Xml.Stream.Format /// this is the format used to format the documents ///
return SimpleFramework.Xml.Filter

Persister() public method

Constructor for the Persister object. This is used to create a serializer object that will use the provided filter. This persister will replace all variables encountered when deserializing an object with mappings found in the filter.
public Persister ( Filter filter ) : SimpleFramework.Xml.Filter
filter Filter /// the filter used to replace template variables ///
return SimpleFramework.Xml.Filter

Persister() public method

Constructor for the Persister object. This is used to create a serializer object that will use the provided filter. This persister will replace all variables encountered when deserializing an object with mappings found in the filter.
public Persister ( Filter filter, Format format ) : SimpleFramework.Xml.Filter
filter Filter /// the filter used to replace template variables ///
format SimpleFramework.Xml.Stream.Format /// this is used to structure the generated XML ///
return SimpleFramework.Xml.Filter

Persister() public method

Constructor for the Persister object. This is used to create a serializer object that will use the provided filter. This persister will replace all variables encountered when deserializing an object with mappings found in the filter.
public Persister ( Filter filter, Matcher matcher ) : SimpleFramework.Xml.Filter
filter Filter /// the filter used to replace template variables ///
matcher Matcher /// this is used to customize the transformations ///
return SimpleFramework.Xml.Filter

Persister() public method

Constructor for the Persister object. This is used to create a serializer object that will use the provided filter. This persister will replace all variables encountered when deserializing an object with mappings found in the filter.
public Persister ( Filter filter, Matcher matcher, Format format ) : SimpleFramework.Xml.Filter
filter Filter /// the filter used to replace template variables ///
matcher Matcher /// this is used to customize the transformations ///
format SimpleFramework.Xml.Stream.Format /// this is used to structure the generated XML ///
return SimpleFramework.Xml.Filter

Persister() public method

Constructor for the Persister object. This is used to create a serializer object that will use the provided format instructions. The persister uses the Format object to structure the generated XML. It determines the indent size of the document and whether it should contain a prolog.
public Persister ( Format format ) : SimpleFramework.Xml.Filter
format SimpleFramework.Xml.Stream.Format /// this is used to structure the generated XML ///
return SimpleFramework.Xml.Filter

Persister() public method

Constructor for the Persister object. This is used to create a serializer object that will use the provided matcher for customizable transformations. The Matcher will enable the persister to determine the correct way to transform the types that are not annotated and considered primitives.
public Persister ( Matcher matcher ) : SimpleFramework.Xml.Filter
matcher Matcher /// this is used to customize the transformations ///
return SimpleFramework.Xml.Filter

Persister() public method

Constructor for the Persister object. This is used to create a serializer object that will use the provided matcher for customizable transformations. The Matcher will enable the persister to determine the correct way to transform the types that are not annotated and considered primitives.
public Persister ( Matcher matcher, Format format ) : SimpleFramework.Xml.Filter
matcher Matcher /// this is used to customize the transformations ///
format SimpleFramework.Xml.Stream.Format /// this is used to structure the generated XML ///
return SimpleFramework.Xml.Filter

Persister() public method

Constructor for the Persister object. This is used to create a serializer object that will use a strategy object. This persister will use the provided Strategy to intercept the XML elements in order to read and write persistent data, such as the class name or version of the document.
public Persister ( Strategy strategy ) : SimpleFramework.Xml.Filter
strategy Strategy /// this is the strategy used to resolve classes ///
return SimpleFramework.Xml.Filter

Persister() public method

Constructor for the Persister object. This is used to create a serializer object that will use a platform filter object using the overrides within the provided map. This means that template variables will be replaced firstly with mappings from within the provided map, followed by system properties.

This persister will use the provided Strategy to intercept the XML elements in order to read and write persistent data, such as the class name or version of the document.

public Persister ( Strategy strategy, Dictionary data ) : SimpleFramework.Xml.Filter
strategy Strategy /// this is the strategy used to resolve classes ///
data Dictionary /// this is the map that contains the overrides ///
return SimpleFramework.Xml.Filter

Persister() public method

Constructor for the Persister object. This is used to create a serializer object that will use the provided filter. This persister will replace all variables encountered when deserializing an object with mappings found in the filter.

This persister will use the provided Strategy to intercept the XML elements in order to read and write persistent data, such as the class name or version of the document.

public Persister ( Strategy strategy, Dictionary data, Format format ) : SimpleFramework.Xml.Filter
strategy Strategy /// this is the strategy used to resolve classes ///
data Dictionary /// the filter data used to replace template variables ///
format SimpleFramework.Xml.Stream.Format /// this is used to format the generated XML document ///
return SimpleFramework.Xml.Filter

Persister() public method

Constructor for the Persister object. This is used to create a serializer object that will use the provided filter. This persister will replace all variables encountered when deserializing an object with mappings found in the filter.

This persister will use the provided Strategy to intercept the XML elements in order to read and write persistent data, such as the class name or version of the document.

public Persister ( Strategy strategy, Filter filter ) : SimpleFramework.Xml.Filter
strategy Strategy /// this is the strategy used to resolve classes ///
filter Filter /// the filter used to replace template variables ///
return SimpleFramework.Xml.Filter

Persister() public method

Constructor for the Persister object. This is used to create a serializer object that will use the provided filter. This persister will replace all variables encountered when deserializing an object with mappings found in the filter.

This persister will use the provided Strategy to intercept the XML elements in order to read and write persistent data, such as the class name or version of the document.

public Persister ( Strategy strategy, Filter filter, Format format ) : SimpleFramework.Xml.Filter
strategy Strategy /// this is the strategy used to resolve classes ///
filter Filter /// the filter used to replace template variables ///
format SimpleFramework.Xml.Stream.Format /// this is used to format the generated XML document ///
return SimpleFramework.Xml.Filter

Persister() public method

Constructor for the Persister object. This is used to create a serializer object that will use the provided matcher for customizable transformations. The Matcher will enable the persister to determine the correct way to transform the types that are not annotated and considered primitives.

This persister will use the provided Strategy to intercept the XML elements in order to read and write persistent data, such as the class name or version of the document.

public Persister ( Strategy strategy, Filter filter, Matcher matcher ) : SimpleFramework.Xml.Filter
strategy Strategy /// this is the strategy used to resolve classes ///
filter Filter /// the filter used to replace template variables ///
matcher Matcher /// this is used to customize the transformations ///
return SimpleFramework.Xml.Filter

Persister() public method

Constructor for the Persister object. This is used to create a serializer object that will use the provided matcher for customizable transformations. The Matcher will enable the persister to determine the correct way to transform the types that are not annotated and considered primitives.

This persister will use the provided Strategy to intercept the XML elements in order to read and write persistent data, such as the class name or version of the document.

public Persister ( Strategy strategy, Filter filter, Matcher matcher, Format format ) : SimpleFramework.Xml.Filter
strategy Strategy /// this is the strategy used to resolve classes ///
filter Filter /// the filter used to replace template variables ///
matcher Matcher /// this is used to customize the transformations ///
format SimpleFramework.Xml.Stream.Format
return SimpleFramework.Xml.Filter

Persister() public method

Constructor for the Persister object. This is used to create a serializer object that will use a strategy object. This persister will use the provided Strategy to intercept the XML elements in order to read and write persistent data, such as the class name or version of the document.
public Persister ( Strategy strategy, Format format ) : SimpleFramework.Xml.Filter
strategy Strategy /// this is the strategy used to resolve classes ///
format SimpleFramework.Xml.Stream.Format /// this is used to structure the generated XML ///
return SimpleFramework.Xml.Filter

Persister() public method

Constructor for the Persister object. This is used to create a serializer object that will use the provided matcher for customizable transformations. The Matcher will enable the persister to determine the correct way to transform the types that are not annotated and considered primitives.

This persister will use the provided Strategy to intercept the XML elements in order to read and write persistent data, such as the class name or version of the document.

public Persister ( Strategy strategy, Matcher matcher ) : SimpleFramework.Xml.Filter
strategy Strategy /// this is the strategy used to resolve classes ///
matcher Matcher /// this is used to customize the transformations ///
return SimpleFramework.Xml.Filter

Persister() public method

Constructor for the Persister object. This is used to create a serializer object that will use the provided matcher for customizable transformations. The Matcher will enable the persister to determine the correct way to transform the types that are not annotated and considered primitives.

This persister will use the provided Strategy to intercept the XML elements in order to read and write persistent data, such as the class name or version of the document.

public Persister ( Strategy strategy, Matcher matcher, Format format ) : SimpleFramework.Xml.Filter
strategy Strategy /// this is the strategy used to resolve classes ///
matcher Matcher /// this is used to customize the transformations ///
format SimpleFramework.Xml.Stream.Format /// this is used to format the generated XML document ///
return SimpleFramework.Xml.Filter