Packageorg.spicefactory.lib.xml
Interfacepublic interface XmlObjectMapper
Implementors AbstractXmlObjectMapper, PropertyMapper

The core interface of the XML-to-Object mapping framework.

In most cases applications should be able to use the XmlObjectMapper implementation produced by the PropertyMapperBuilder class. But for unusual use cases new implementations of this interface can be created from scratch to be combined with the existing ones. In a complex XML hierarchy it is usually recommended to create a corresponding hierarchy of mappers where each mapper is only responsible for mapping a single element, delegating work to child mapper for child elements.



Public Properties
 PropertyDefined By
  elementName : QName
[read-only] The name of the elements the mapToXml method produces.
XmlObjectMapper
  objectType : ClassInfo
[read-only] The type of the objects the mapToObject method produces.
XmlObjectMapper
Public Methods
 MethodDefined By
  
mapToObject(element:XML, context:XmlProcessorContext = null):Object
Maps from XML to object.
XmlObjectMapper
  
mapToXml(object:Object, context:XmlProcessorContext = null):XML
Maps from object to XML.
XmlObjectMapper
Property Detail
elementNameproperty
elementName:QName  [read-only]

The name of the elements the mapToXml method produces.


Implementation
    public function get elementName():QName
objectTypeproperty 
objectType:ClassInfo  [read-only]

The type of the objects the mapToObject method produces.


Implementation
    public function get objectType():ClassInfo
Method Detail
mapToObject()method
public function mapToObject(element:XML, context:XmlProcessorContext = null):Object

Maps from XML to object. Should always return objects of the type the objectType property was set to.

Parameters

element:XML — the XML element to be transformed to an object
 
context:XmlProcessorContext (default = null) — the processing context

Returns
Object — a new object that maps to the specified XML element
mapToXml()method 
public function mapToXml(object:Object, context:XmlProcessorContext = null):XML

Maps from object to XML. Should always return XML elements with the name the elementName property was set to.

Parameters

object:Object — the object to be transformed to an XML element
 
context:XmlProcessorContext (default = null) — the processing context

Returns
XML — a new XML element that maps to the specified object