Packageorg.spicefactory.lib.xml.mapper
Interfacepublic interface PropertyHandler
Implementors AbstractPropertyHandler

Responsible for mapping a single property of a mapped class to an XML element, attribute or text node.



Public Properties
 PropertyDefined By
  nodeKind : String
[read-only] The kind of the mapped node.
PropertyHandler
  property : Property
[read-only] The Property the XML element, attribute or text node should map to.
PropertyHandler
  xmlNames : Array
[read-only] The names of the mapped XML elements, attributes or text nodes.
PropertyHandler
Public Methods
 MethodDefined By
  
toObject(nodes:Array, parentInstance:Object, context:XmlProcessorContext):void
Maps the specified XML elements, attributes or text nodes to the mapped property of the specified instance.
PropertyHandler
  
toXML(instance:Object, parentElement:XML, context:XmlProcessorContext):void
Maps the property value this handler is responsible for to the specified XML elements.
PropertyHandler
Property Detail
nodeKindproperty
nodeKind:String  [read-only]

The kind of the mapped node. Either element, attribute or text.


Implementation
    public function get nodeKind():String
propertyproperty 
property:Property  [read-only]

The Property the XML element, attribute or text node should map to.


Implementation
    public function get property():Property
xmlNamesproperty 
xmlNames:Array  [read-only]

The names of the mapped XML elements, attributes or text nodes. For Array properties the Array may contain more than one XML name.


Implementation
    public function get xmlNames():Array
Method Detail
toObject()method
public function toObject(nodes:Array, parentInstance:Object, context:XmlProcessorContext):void

Maps the specified XML elements, attributes or text nodes to the mapped property of the specified instance.

Parameters

nodes:Array — the XML elements, attributes or text nodes to apply as a property value
 
parentInstance:Object — the instance the property should be set for
 
context:XmlProcessorContext — the processing context

toXML()method 
public function toXML(instance:Object, parentElement:XML, context:XmlProcessorContext):void

Maps the property value this handler is responsible for to the specified XML elements.

Parameters

instance:Object — the instance the to read the property value from
 
parentElement:XML — the XML element to apply the property value to, either as an attribute, text node or child element
 
context:XmlProcessorContext — the processing context