Class XmlMappingMetaData
- java.lang.Object
-
- net.officefloor.plugin.xml.unmarshall.tree.XmlMappingMetaData
-
public class XmlMappingMetaData extends java.lang.Object
Meta-data of theXmlContext
.- Author:
- Daniel Sagenschneider
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
elementName
Name of XML element/attribute which is the focus of this mapping.protected java.lang.String
format
Format for loading a value.protected java.lang.String
id
Identifies this XML mapping for reuse (or if already configured to use the same configuration).protected java.lang.String
loadMethodName
Name of method to load value/object to target object.protected java.lang.String
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.protected java.util.List<XmlMappingMetaData>
loadObjectConfiguration
The mappings of the loaded object, should theloadObjectClassName
be specified.protected java.lang.String
staticValue
Static value to load to target object.protected XmlMappingType
type
Type of this mapping.
-
Constructor Summary
Constructors Constructor Description XmlMappingMetaData()
Default constructor to allow theTreeXmlUnmarshaller
to configure itself.XmlMappingMetaData(java.lang.Class<?> targetObjectType, java.lang.String rootElementName, XmlMappingMetaData[] targetObjectConfiguration)
Convenience constructor for configuring the root of the mapping tree.XmlMappingMetaData(java.lang.String loadMethodName, java.lang.String id)
Convenience constructor for configuring to load by reference.XmlMappingMetaData(java.lang.String elementName, java.lang.String loadMethodName, java.lang.Class<?> loadObjectClass, XmlMappingMetaData[] loadObjectConfiguration, java.lang.String id)
Convenience constructor for configuring to load an object.XmlMappingMetaData(java.lang.String elementName, java.lang.String loadMethodName, java.lang.String format)
Convenience constructor for configuring to load a value.XmlMappingMetaData(XmlMappingType type, java.lang.String loadMethodName, java.lang.String staticValue)
Convenience constructor for configuring to load a static reference.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addLoadObjectConfiguration(XmlMappingMetaData loadObjectMapping)
Adds anotherXmlMappingMetaData
configuration for the object to load onto the target object.java.lang.String
getElementName()
Obtains the XML element/attribute name.java.lang.String
getFormat()
Obtains the format for loading the value.java.lang.String
getId()
Obtains the identifier of this XML mapping.java.lang.String
getLoadMethodName()
Obtains the name of the method on the target object to load the value/object.java.lang.String
getLoadObjectClassName()
Obtains the fully qualified name of the class of the object to be loaded to the target object.XmlMappingMetaData[]
getLoadObjectConfiguration()
Obtains the configuration for the object to load onto the target object.java.lang.String
getStaticValue()
Obtains the static value to load to target object.XmlMappingType
getType()
Obtains the type of this mapping.void
setElementName(java.lang.String elementName)
Specifies the XML element/attribute name.void
setFormat(java.lang.String format)
Specifies the format for loading the value.void
setId(java.lang.String id)
Specifies the identifier of the XML mapping.void
setLoadMethodName(java.lang.String loadMethodName)
Specifies the name of the method on the target object to load the value/object.void
setLoadObjectClassName(java.lang.String loadObjectClassName)
Specifies the fully qualified name of the class of the object to be loaded to the target object.void
setStaticValue(java.lang.String staticValue)
Specifies the static value to load to target object.void
setType(java.lang.String typeName)
Enables specifying the type name.
-
-
-
Field Detail
-
id
protected java.lang.String id
Identifies this XML mapping for reuse (or if already configured to use the same configuration).
-
elementName
protected java.lang.String elementName
Name of XML element/attribute which is the focus of this mapping.
-
loadMethodName
protected java.lang.String loadMethodName
Name of method to load value/object to target object.
-
loadObjectClassName
protected java.lang.String 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
protected java.lang.String format
Format for loading a value.
-
staticValue
protected java.lang.String staticValue
Static value to load to target object.
-
loadObjectConfiguration
protected java.util.List<XmlMappingMetaData> loadObjectConfiguration
The mappings of the loaded object, should theloadObjectClassName
be specified.
-
type
protected XmlMappingType type
Type of this mapping.
-
-
Constructor Detail
-
XmlMappingMetaData
public XmlMappingMetaData()
Default constructor to allow theTreeXmlUnmarshaller
to configure itself.
-
XmlMappingMetaData
public XmlMappingMetaData(java.lang.Class<?> targetObjectType, java.lang.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
public XmlMappingMetaData(java.lang.String elementName, java.lang.String loadMethodName, java.lang.String format)
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(java.lang.String elementName, java.lang.String loadMethodName, java.lang.Class<?> loadObjectClass, XmlMappingMetaData[] loadObjectConfiguration, java.lang.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
public XmlMappingMetaData(java.lang.String loadMethodName, java.lang.String id)
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
public XmlMappingMetaData(XmlMappingType type, java.lang.String loadMethodName, java.lang.String staticValue)
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 Detail
-
getType
public XmlMappingType getType() throws XmlMarshallException
Obtains the type of this mapping.- Returns:
- Type of this mapping.
- Throws:
XmlMarshallException
- If no type has been specified.
-
setType
public void setType(java.lang.String typeName)
Enables specifying the type name.- Parameters:
typeName
- Name of the type.
-
getId
public java.lang.String getId()
Obtains the identifier of this XML mapping.- Returns:
- Identifier of XML mapping.
-
setId
public void setId(java.lang.String id)
Specifies the identifier of the XML mapping.- Parameters:
id
- Identifier of the XML mapping.
-
getElementName
public java.lang.String getElementName()
Obtains the XML element/attribute name.- Returns:
- XML element/attribute name.
-
setElementName
public void setElementName(java.lang.String elementName)
Specifies the XML element/attribute name.- Parameters:
elementName
- XML element/attribute name.
-
getLoadMethodName
public java.lang.String getLoadMethodName()
Obtains the name of the method on the target object to load the value/object.- Returns:
- Load method name.
-
setLoadMethodName
public void setLoadMethodName(java.lang.String loadMethodName)
Specifies the name of the method on the target object to load the value/object.- Parameters:
loadMethodName
- Load method name.
-
getLoadObjectClassName
public java.lang.String 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
public void setLoadObjectClassName(java.lang.String loadObjectClassName)
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
public java.lang.String getFormat()
Obtains the format for loading the value.- Returns:
- Format for loading the value.
-
setFormat
public void setFormat(java.lang.String format)
Specifies the format for loading the value.- Parameters:
format
- Format for loading the value.
-
getStaticValue
public java.lang.String getStaticValue()
Obtains the static value to load to target object.- Returns:
- Static value.
-
setStaticValue
public void setStaticValue(java.lang.String staticValue)
Specifies the static value to load to target object.- Parameters:
staticValue
- Static value.
-
getLoadObjectConfiguration
public XmlMappingMetaData[] getLoadObjectConfiguration()
Obtains the configuration for the object to load onto the target object.- Returns:
- Load object configuration.
-
addLoadObjectConfiguration
public void addLoadObjectConfiguration(XmlMappingMetaData loadObjectMapping)
Adds anotherXmlMappingMetaData
configuration for the object to load onto the target object.- Parameters:
loadObjectMapping
-XmlMappingMetaData
for the object to load onto the target object.
-
-