Class XmlMappingMetaData
java.lang.Object
net.officefloor.plugin.xml.unmarshall.tree.XmlMappingMetaData
Meta-data of the
XmlContext.- Author:
- Daniel Sagenschneider
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringName of XML element/attribute which is the focus of this mapping.protected StringFormat for loading a value.protected StringIdentifies this XML mapping for reuse (or if already configured to use the same configuration).protected StringName of method to load value/object to target object.protected StringShould this be an object loading mapping, then this should be specified and be the fully quanlified name of the class of the object to load.protected List<XmlMappingMetaData>The mappings of the loaded object, should theloadObjectClassNamebe specified.protected StringStatic value to load to target object.protected XmlMappingTypeType of this mapping. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor to allow theTreeXmlUnmarshallerto configure itself.XmlMappingMetaData(Class<?> targetObjectType, String rootElementName, XmlMappingMetaData[] targetObjectConfiguration) Convenience constructor for configuring the root of the mapping tree.XmlMappingMetaData(String loadMethodName, String id) Convenience constructor for configuring to load by reference.XmlMappingMetaData(String elementName, String loadMethodName, Class<?> loadObjectClass, XmlMappingMetaData[] loadObjectConfiguration, String id) Convenience constructor for configuring to load an object.XmlMappingMetaData(String elementName, String loadMethodName, String format) Convenience constructor for configuring to load a value.XmlMappingMetaData(XmlMappingType type, String loadMethodName, String staticValue) Convenience constructor for configuring to load a static reference. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLoadObjectConfiguration(XmlMappingMetaData loadObjectMapping) Adds anotherXmlMappingMetaDataconfiguration for the object to load onto the target object.Obtains the XML element/attribute name.Obtains the format for loading the value.getId()Obtains the identifier of this XML mapping.Obtains the name of the method on the target object to load the value/object.Obtains the fully qualified name of the class of the object to be loaded to the target object.Obtains the configuration for the object to load onto the target object.Obtains the static value to load to target object.getType()Obtains the type of this mapping.voidsetElementName(String elementName) Specifies the XML element/attribute name.voidSpecifies the format for loading the value.voidSpecifies the identifier of the XML mapping.voidsetLoadMethodName(String loadMethodName) Specifies the name of the method on the target object to load the value/object.voidsetLoadObjectClassName(String loadObjectClassName) Specifies the fully qualified name of the class of the object to be loaded to the target object.voidsetStaticValue(String staticValue) Specifies the static value to load to target object.voidEnables specifying the type name.
-
Field Details
-
id
Identifies this XML mapping for reuse (or if already configured to use the same configuration). -
elementName
Name of XML element/attribute which is the focus of this mapping. -
loadMethodName
Name of method to load value/object to target object. -
loadObjectClassName
Should this be an object loading mapping, then this should be specified and be the fully quanlified name of the class of the object to load. -
format
Format for loading a value. -
staticValue
Static value to load to target object. -
loadObjectConfiguration
The mappings of the loaded object, should theloadObjectClassNamebe specified. -
type
Type of this mapping.
-
-
Constructor Details
-
XmlMappingMetaData
public XmlMappingMetaData()Default constructor to allow theTreeXmlUnmarshallerto configure itself. -
XmlMappingMetaData
public XmlMappingMetaData(Class<?> targetObjectType, String rootElementName, XmlMappingMetaData[] targetObjectConfiguration) Convenience constructor for configuring the root of the mapping tree.- Parameters:
targetObjectType- Class of the target object.rootElementName- Root XML element name.targetObjectConfiguration- Configuration of the target object.
-
XmlMappingMetaData
Convenience constructor for configuring to load a value.- Parameters:
elementName- XML element/attribute name containing the value.loadMethodName- Method by which to load the value onto the target object.format- Format of the value if required otherwise make passnull.
-
XmlMappingMetaData
public XmlMappingMetaData(String elementName, String loadMethodName, Class<?> loadObjectClass, XmlMappingMetaData[] loadObjectConfiguration, String id) Convenience constructor for configuring to load an object.- Parameters:
elementName- XML element name.loadMethodName- Method by which to load the object onto the target object.loadObjectClass- Class of the object to load onto the target object.loadObjectConfiguration- Configuration of load object.id- Identifier of the XML mapping. If not be re-used may benull.
-
XmlMappingMetaData
Convenience constructor for configuring to load by reference.- Parameters:
loadMethodName- Method by which to begin reference loading to target object.id- Identifier of the XML mapping to re-use.
-
XmlMappingMetaData
Convenience constructor for configuring to load a static reference.- Parameters:
type- Type of this XML mapping.loadMethodName- Method by which to load the static value to target object.staticValue- Static value to load to target object.
-
-
Method Details
-
getType
Obtains the type of this mapping.- Returns:
- Type of this mapping.
- Throws:
XmlMarshallException- If no type has been specified.
-
setType
Enables specifying the type name.- Parameters:
typeName- Name of the type.
-
getId
Obtains the identifier of this XML mapping.- Returns:
- Identifier of XML mapping.
-
setId
Specifies the identifier of the XML mapping.- Parameters:
id- Identifier of the XML mapping.
-
getElementName
Obtains the XML element/attribute name.- Returns:
- XML element/attribute name.
-
setElementName
Specifies the XML element/attribute name.- Parameters:
elementName- XML element/attribute name.
-
getLoadMethodName
Obtains the name of the method on the target object to load the value/object.- Returns:
- Load method name.
-
setLoadMethodName
Specifies the name of the method on the target object to load the value/object.- Parameters:
loadMethodName- Load method name.
-
getLoadObjectClassName
Obtains the fully qualified name of the class of the object to be loaded to the target object.- Returns:
- Load object class name.
-
setLoadObjectClassName
Specifies the fully qualified name of the class of the object to be loaded to the target object.- Parameters:
loadObjectClassName- Load object class name.
-
getFormat
Obtains the format for loading the value.- Returns:
- Format for loading the value.
-
setFormat
Specifies the format for loading the value.- Parameters:
format- Format for loading the value.
-
getStaticValue
Obtains the static value to load to target object.- Returns:
- Static value.
-
setStaticValue
Specifies the static value to load to target object.- Parameters:
staticValue- Static value.
-
getLoadObjectConfiguration
Obtains the configuration for the object to load onto the target object.- Returns:
- Load object configuration.
-
addLoadObjectConfiguration
Adds anotherXmlMappingMetaDataconfiguration for the object to load onto the target object.- Parameters:
loadObjectMapping-XmlMappingMetaDatafor the object to load onto the target object.
-