Packageorg.spicefactory.lib.xml.mapper.handler
Classpublic class AttributeHandler
InheritanceAttributeHandler Inheritance AbstractPropertyHandler Inheritance Object

Responsible for mapping properties to attribute values.



Public Properties
 PropertyDefined By
 InheritednodeKind : String
[read-only] The kind of the mapped node.
AbstractPropertyHandler
 Inheritedproperty : Property
[read-only] The Property the XML element, attribute or text node should map to.
AbstractPropertyHandler
 InheritedxmlNames : Array
[read-only] The names of the mapped XML elements, attributes or text nodes.
AbstractPropertyHandler
Protected Properties
 PropertyDefined By
 Inheritedrequired : Boolean
[read-only] Indicates whether this attribute is required.
AbstractPropertyHandler
 InheritedsingleValue : Boolean
[read-only] Indicates whether this handler maps a single-valued or multi-valued (Array) property.
AbstractPropertyHandler
Public Methods
 MethodDefined By
  
AttributeHandler(property:Property, xmlName:QName)
Creates a new instance.
AttributeHandler
 Inherited
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.
AbstractPropertyHandler
  
toXML(instance:Object, parentElement:XML, context:XmlProcessorContext):void
[override] Maps the property value this handler is responsible for to the specified XML elements.
AttributeHandler
Protected Methods
 MethodDefined By
 Inherited
getValue(instance:Object):*
Gets the value of the mapped property from the specified instance.
AbstractPropertyHandler
 Inherited
getValueAsString(instance:Object):String
Gets the value of the mapped property from the specified instance as a String.
AbstractPropertyHandler
 Inherited
Extracts the value from the specified node, resolving any variables that nodes with simple content possibly contain.
AbstractPropertyHandler
 Inherited
validateValueCount(count:int):void
Validates the specified number of mapped XML elements, attributes or text nodes.
AbstractPropertyHandler
Constructor Detail
AttributeHandler()Constructor
public function AttributeHandler(property:Property, xmlName:QName)

Creates a new instance.

Parameters
property:Property — the property the attribute value should be applied to
 
xmlName:QName — the names of the mapped XML attributes or elements
Method Detail
toXML()method
override 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