Packageorg.spicefactory.lib.xml
Classpublic class XmlProcessorContext
InheritanceXmlProcessorContext Inheritance Object

The context for a recursive XML processing operation. Holds the ApplicationDomain and ExpressionContext that the mappers participating in the operation may use. Allows to add namespace which may be used when mapping from object to XML, since the mappers need to know the prefix they should use.



Public Properties
 PropertyDefined By
  applicationDomain : ApplicationDomain
[read-only] The ApplicationDomain to use when reflecting on objects.
XmlProcessorContext
  data : Object
[read-only] Arbitrary data assigned to this context which may be needed by participating mappers.
XmlProcessorContext
  errors : Array
[read-only] All Errors that were already added to this context.
XmlProcessorContext
  expressionContext : ExpressionContext
[read-only] The expression context containing variable values the participating mappers can use for resolving values.
XmlProcessorContext
Public Methods
 MethodDefined By
  
XmlProcessorContext(expressionContext:ExpressionContext = null, domain:ApplicationDomain = null, data:Object = null)
Creates a new instance.
XmlProcessorContext
  
addError(error:Error):void
Adds an Error to this context.
XmlProcessorContext
  
addNamespace(ns:Namespace):void
Adds the specified namespace to the context.
XmlProcessorContext
  
addNamespaceDeclarations(element:XML):void
Adds the namespace declarations added to this context to the specified element.
XmlProcessorContext
  
hasErrors():Boolean
Returns true when this context contains errors.
XmlProcessorContext
Property Detail
applicationDomainproperty
applicationDomain:ApplicationDomain  [read-only]

The ApplicationDomain to use when reflecting on objects.


Implementation
    public function get applicationDomain():ApplicationDomain
dataproperty 
data:Object  [read-only]

Arbitrary data assigned to this context which may be needed by participating mappers.


Implementation
    public function get data():Object
errorsproperty 
errors:Array  [read-only]

All Errors that were already added to this context.


Implementation
    public function get errors():Array
expressionContextproperty 
expressionContext:ExpressionContext  [read-only]

The expression context containing variable values the participating mappers can use for resolving values.


Implementation
    public function get expressionContext():ExpressionContext
Constructor Detail
XmlProcessorContext()Constructor
public function XmlProcessorContext(expressionContext:ExpressionContext = null, domain:ApplicationDomain = null, data:Object = null)

Creates a new instance.

Parameters
expressionContext:ExpressionContext (default = null) — the expression context containing variable values the participating mappers can use for resolving values
 
domain:ApplicationDomain (default = null) — the ApplicationDomain to use for reflecting on classes
 
data:Object (default = null) — arbitrary data participating mapper may need
Method Detail
addError()method
public function addError(error:Error):void

Adds an Error to this context. Individual mappers should try not to operate in fail-fast mode, allowing multiple errors to be collected before an Error is finally thrown.

Parameters

error:Error — the error to add to this context

addNamespace()method 
public function addNamespace(ns:Namespace):void

Adds the specified namespace to the context. Will only be considered when mapping from object to XML not vice-versa. The participating mapper may query the preferred namespace prefix for objects mapped to XML elements in namespaces.

Parameters

ns:Namespace — the namespace to add to this context

addNamespaceDeclarations()method 
public function addNamespaceDeclarations(element:XML):void

Adds the namespace declarations added to this context to the specified element. May be used for root XML elements after mapping to avoid having namespace declarations cluttered throughout child elements.

Parameters

element:XML — the element to add all namespace declarations used in this context to

hasErrors()method 
public function hasErrors():Boolean

Returns true when this context contains errors.

Returns
Boolean — true when this context contains errors