Packageorg.spicefactory.lib.xml.mapper
Classpublic class MetadataMapperBuilder
InheritanceMetadataMapperBuilder Inheritance PropertyMapperBuilder Inheritance Object

Extension of the base PropertyMapperBuilder that supports mapping configuration with metadata.



Public Properties
 PropertyDefined By
 InheriteddefaultNamingStrategy : NamingStrategy
[static] The default naming strategy to use for transforming property names to XML attribute or element names.
PropertyMapperBuilder
 InheritedelementName : QName
[read-only] The name of the mapped XML element.
PropertyMapperBuilder
 InheritednamingStrategy : NamingStrategy
[read-only] The naming strategy to use for transforming property names to XML attribute and element names.
PropertyMapperBuilder
 InheritedobjectType : ClassInfo
[read-only] The mapped object type.
PropertyMapperBuilder
Public Methods
 MethodDefined By
  
MetadataMapperBuilder(objectType:Class, elementName:QName, choices:ChoiceRegistry, namingStrategy:NamingStrategy = null, domain:ApplicationDomain = null)
Creates a new instance for building a mapper that maps the specified objectType to the XML element with the specified name.
MetadataMapperBuilder
 Inherited
Adds a custom property handler to this builder.
PropertyMapperBuilder
 Inherited
Builds the final mapper based on the instructions that were given through the various mapmethods of this class.
PropertyMapperBuilder
 Inherited
createChildElementMapperBuilder(propertyName:String, type:Class = null, elementName:QName = null):PropertyMapperBuilder
Convenient short cut to produce a mapper for a child element that will then be mapped to a property of the class mapped by this builder.
PropertyMapperBuilder
 Inherited
ignoreProperty(propertyName:String):void
Instructs this builder not to map the property with the specified name.
PropertyMapperBuilder
 Inherited
Instructs this builder to ignore attributes in XML that are not mapped to properties.
PropertyMapperBuilder
 Inherited
Instructs this builder to ignore child elements in XML that are not mapped to properties.
PropertyMapperBuilder
 Inherited
Maps all properties of the mapped class to attribute of the mapped XML element.
PropertyMapperBuilder
 Inherited
Maps all properties of the mapped class to text nodes of child elements of the mapped XML element.
PropertyMapperBuilder
 Inherited
mapToAttribute(propertyName:String, attributeName:QName = null):void
Maps the property with the specified name to the XML attribute with the specified name.
PropertyMapperBuilder
 Inherited
mapToChildElement(propertyName:String, mapper:XmlObjectMapper):void
Maps the property with the specified name to the object mapped to the specified XML element.
PropertyMapperBuilder
 Inherited
mapToChildElementChoice(propertyName:String, choice:Choice):void
Maps the property with the specified name to the objects of a choice of mapped child elements.
PropertyMapperBuilder
 Inherited
mapToChildTextNode(propertyName:String, childName:QName = null):void
Maps the property with the specified name to the XML text node of the child element with the specified name.
PropertyMapperBuilder
  
mapToChoiceId(propertyName:String, id:String):void
Maps the property with the specified name to the objects of a choice of child elements with a particular string identifier.
MetadataMapperBuilder
  
mapToChoiceType(propertyName:String, type:Class):void
Maps the property with the specified name to the objects of a choice of child elements that map to a particular interface or class and its subtypes and implementors.
MetadataMapperBuilder
 Inherited
mapToTextNode(propertyName:String):void
Maps the property with the specified name to the XML text node inside the mapped XML element.
PropertyMapperBuilder
Protected Methods
 MethodDefined By
 Inherited
isMappableProperty(property:Property):Boolean
Checks whether the specified property can still be mapped.
PropertyMapperBuilder
 Inherited
updateElementName(newName:QName):void
Updates the XML element name to apply to this mapping.
PropertyMapperBuilder
Constructor Detail
MetadataMapperBuilder()Constructor
public function MetadataMapperBuilder(objectType:Class, elementName:QName, choices:ChoiceRegistry, namingStrategy:NamingStrategy = null, domain:ApplicationDomain = null)

Creates a new instance for building a mapper that maps the specified objectType to the XML element with the specified name.

Parameters
objectType:Class — the type of the object to map to the XML element
 
elementName:QName — the name of the XML element to map
 
choices:ChoiceRegistry — the registry for choices
 
namingStrategy:NamingStrategy (default = null) — the naming strategy to use for transforming property names to XML attribute and element names
 
domain:ApplicationDomain (default = null) — the ApplicationDomain to use for reflecting on the mapped type
Method Detail
mapToChoiceId()method
public function mapToChoiceId(propertyName:String, id:String):void

Maps the property with the specified name to the objects of a choice of child elements with a particular string identifier. The choice is specified through an id and the elements which represent valid options for that choice have to be specified with XmlObjectMappings.choicId.

Parameters

propertyName:String — the name of the property to map to the specified choice of child elements
 
id:String — the id of the choice as specified in the corresponding XmlObjectMappings instance

mapToChoiceType()method 
public function mapToChoiceType(propertyName:String, type:Class):void

Maps the property with the specified name to the objects of a choice of child elements that map to a particular interface or class and its subtypes and implementors.

Parameters

propertyName:String — the name of the property to map to the specified choice of child elements
 
type:Class — the type that all permitted elements of the choice map to (including subtypes)