Package | org.spicefactory.lib.xml.mapper |
Class | public class MetadataMapperBuilder |
Inheritance | MetadataMapperBuilder PropertyMapperBuilder Object |
Method | Defined 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 | ||
addPropertyHandler(handler:PropertyHandler):void
Adds a custom property handler to this builder. | PropertyMapperBuilder | ||
Builds the final mapper based on the instructions that were given through the various
mapmethods of this class. | PropertyMapperBuilder | ||
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 | ||
ignoreProperty(propertyName:String):void
Instructs this builder not to map the property with the specified name. | PropertyMapperBuilder | ||
ignoreUnmappedAttributes():void
Instructs this builder to ignore attributes in XML that are not mapped to properties. | PropertyMapperBuilder | ||
ignoreUnmappedChildren():void
Instructs this builder to ignore child elements in XML that are not mapped to properties. | PropertyMapperBuilder | ||
mapAllToAttributes():void
Maps all properties of the mapped class to attribute of the mapped XML element. | PropertyMapperBuilder | ||
mapAllToChildTextNodes():void
Maps all properties of the mapped class to text nodes of child elements of the mapped XML element. | PropertyMapperBuilder | ||
mapToAttribute(propertyName:String, attributeName:QName = null):void
Maps the property with the specified name to the XML attribute with the specified name. | PropertyMapperBuilder | ||
mapToChildElement(propertyName:String, mapper:XmlObjectMapper):void
Maps the property with the specified name to the object mapped to the specified XML element. | PropertyMapperBuilder | ||
mapToChildElementChoice(propertyName:String, choice:Choice):void
Maps the property with the specified name to the objects of a choice of mapped child elements. | PropertyMapperBuilder | ||
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 | ||
mapToTextNode(propertyName:String):void
Maps the property with the specified name to the XML text node inside the mapped XML element. | PropertyMapperBuilder |
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.
ParametersobjectType: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
|
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)
|