Package | org.spicefactory.lib.xml |
Class | public class XmlProcessorContext |
Inheritance | XmlProcessorContext Object |
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.
Property | Defined 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 |
Method | Defined 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 |
applicationDomain | property |
applicationDomain:ApplicationDomain
[read-only] The ApplicationDomain to use when reflecting on objects.
public function get applicationDomain():ApplicationDomain
data | property |
data:Object
[read-only] Arbitrary data assigned to this context which may be needed by participating mappers.
public function get data():Object
errors | property |
errors:Array
[read-only] All Errors that were already added to this context.
public function get errors():Array
expressionContext | property |
expressionContext:ExpressionContext
[read-only] The expression context containing variable values the participating mappers can use for resolving values.
public function get expressionContext():ExpressionContext
XmlProcessorContext | () | Constructor |
public function XmlProcessorContext(expressionContext:ExpressionContext = null, domain:ApplicationDomain = null, data:Object = null)
Creates a new instance.
ParametersexpressionContext: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
|
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.
ReturnsBoolean — true when this context contains errors
|