C# Class SimpleFramework.Xml.Core.Decorator

This acts as a strategy and intercepts all XML elements that are serialized and deserialized so that the XML can be manipulated by the provided interceptor implementation.
Inheritance: Strategy
Exibir arquivo Open project: restlet/simplexml Class Usage Examples

Public Methods

Method Description
Decorator ( SimpleFramework.Xml.Core.Interceptor interceptor, Strategy strategy ) : SimpleFramework.Xml.Strategy
Read ( Type field, NodeMap node, Dictionary map ) : Value

Here we intercept the call to get the element value from the strategy so that we can change the attributes in the XML element to match what was change on writing the element.

Write ( Type field, Object value, NodeMap node, Dictionary map ) : bool

Here we change the XML element after it has been annotated by the strategy. In this way we can ensure we write what we want to the resulting XML document.

Method Details

Decorator() public method

public Decorator ( SimpleFramework.Xml.Core.Interceptor interceptor, Strategy strategy ) : SimpleFramework.Xml.Strategy
interceptor SimpleFramework.Xml.Core.Interceptor
strategy Strategy
return SimpleFramework.Xml.Strategy

Read() public method

Here we intercept the call to get the element value from the strategy so that we can change the attributes in the XML element to match what was change on writing the element.
public Read ( Type field, NodeMap node, Dictionary map ) : Value
field Type
node NodeMap /// this is the XML element to be modified ///
map Dictionary
return Value

Write() public method

Here we change the XML element after it has been annotated by the strategy. In this way we can ensure we write what we want to the resulting XML document.
public Write ( Type field, Object value, NodeMap node, Dictionary map ) : bool
field Type
value Object
node NodeMap /// this is the XML element that will be written ///
map Dictionary
return bool