Class XmlMappingMetaData
java.lang.Object
net.officefloor.plugin.xml.marshall.tree.XmlMappingMetaData
Contains the meta-data of the XML mappings.
- Author:
- Daniel Sagenschneider
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringAttribute name flagging this mapping, if set, to be an attribute.protected StringElement name for this mapping.protected StringName of method to object the value/object for this mapping.protected StringId for referencing.protected booleanIndicates if to use the value raw.protected List<XmlMappingMetaData>The mappings of the object in current context.protected StringStatic value for the mapping.protected XmlMappingTypeType of this Xml Mapping.protected StringUpper bound type of the object that this mapping is sourcing from. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor to allow theTreeXmlUnmarshallerto configure this.XmlMappingMetaData(XmlMappingType type, String elementName, Class<?> upperType, XmlMappingMetaData[] configuration, String id) Convenience constructor for creating the root/item mapping configuration.XmlMappingMetaData(XmlMappingType type, String getMethodName, String id) Convenience constructor for creating a reference mapping.XmlMappingMetaData(XmlMappingType type, String tagName, String getMethodName, boolean isUseRaw) Convenience constructor for creating an attribute/value mapping.XmlMappingMetaData(XmlMappingType type, String elementName, String getMethodName, XmlMappingMetaData[] objectMappings, String id) Convenience constructor for creating a collection/object mapping.XmlMappingMetaData(XmlMappingType type, XmlMappingMetaData[] attributes) Convenience constructor for creating attributes mapping. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddObjectMapping(XmlMappingMetaData mapping) Adds aXmlMappingMetaDatafor the object in the current context.Obtains the attribute name.Obtains the elemenet name.Obtains the name of the method to get the value from the object in the current context.getId()Obtains the Id for reference mapping.Obtains the meta-data of the mappings for the object in the current context.Obtains the static value for the element/attribute.getType()Obtains the type of this XML mapping.Obtains the class name of the upper bound type of the current object in the context.booleanisUseRaw()Indicates whether the value should be used raw or whether it should be transformed for XML (ie special characters substituted).protected voidloadObjectMappings(XmlMappingMetaData[] objectMappings) Loads the object mappings.voidsetAttributeName(String attributeName) Specifies the attribute name.voidsetElementName(String elementName) Specifies the element name.voidsetGetMethodName(String getMethodName) Specifies the name of the method to get the value from the object in the current context.voidSpecifies the Id for reference mapping.voidsetIsUseRaw(String isUseRaw) Specifies whether the value should be used raw or whether it should be transformed for XML (ie special characters subsituted).voidSpecifies the type of this XML mapping.voidsetUpperBoundType(String type) Specifies the class name of the upper bound type of the current object in the context.
-
Field Details
-
upperBoundType
Upper bound type of the object that this mapping is sourcing from. -
elementName
Element name for this mapping. -
attributeName
Attribute name flagging this mapping, if set, to be an attribute. -
getMethodName
Name of method to object the value/object for this mapping. -
staticValue
Static value for the mapping. -
isUseRaw
protected boolean isUseRawIndicates if to use the value raw. -
objectMappings
The mappings of the object in current context. -
type
Type of this Xml Mapping. -
id
Id for referencing.
-
-
Constructor Details
-
XmlMappingMetaData
public XmlMappingMetaData()Default constructor to allow theTreeXmlUnmarshallerto configure this. -
XmlMappingMetaData
public XmlMappingMetaData(XmlMappingType type, String elementName, Class<?> upperType, XmlMappingMetaData[] configuration, String id) Convenience constructor for creating the root/item mapping configuration.- Parameters:
type- EitherXmlMappingType.ROOTorXmlMappingType.ITEM.elementName- Name of root element.upperType- Upper bound type of root object.configuration- Configuration of the root object.id- Id to reference. May benullif not referenced.
-
XmlMappingMetaData
Convenience constructor for creating attributes mapping.- Parameters:
type-XmlMappingType.ATTRIBUTES.attributes- Mapping for the attributes of element.
-
XmlMappingMetaData
public XmlMappingMetaData(XmlMappingType type, String tagName, String getMethodName, boolean isUseRaw) Convenience constructor for creating an attribute/value mapping.- Parameters:
type- EitherXmlMappingType.ATTRIBUTEorXmlMappingType.VALUE.tagName- Name of the attribute/element.getMethodName- Method to obtain the value.isUseRaw- Indicates if use the raw value from object.
-
XmlMappingMetaData
public XmlMappingMetaData(XmlMappingType type, String elementName, String getMethodName, XmlMappingMetaData[] objectMappings, String id) Convenience constructor for creating a collection/object mapping.- Parameters:
type- EitherXmlMappingType.COLLECTION,XmlMappingType.TYPEorXmlMappingType.OBJECT.elementName- Name of element for context.getMethodName- Method to obtain object.objectMappings- Configuration of the mappings for the object.id- Id for referencing this.
-
XmlMappingMetaData
Convenience constructor for creating a reference mapping.- Parameters:
type-XmlMappingType.REFERENCE.getMethodName- Method to obtain object.id- Id of mapping to handle object.
-
-
Method Details
-
getElementName
Obtains the elemenet name.- Returns:
- Name for the element.
-
setElementName
Specifies the element name.- Parameters:
elementName- Name for the element.
-
getAttributeName
Obtains the attribute name.- Returns:
- Name for the attribute.
-
setAttributeName
Specifies the attribute name.- Parameters:
attributeName- Name for the attribute.
-
getObjectMappings
Obtains the meta-data of the mappings for the object in the current context.- Returns:
- Meta-data of the mappings for the object in the current context.
-
addObjectMapping
Adds aXmlMappingMetaDatafor the object in the current context.- Parameters:
mapping- Meta-data mapping for object in current context.
-
getUpperBoundType
Obtains the class name of the upper bound type of the current object in the context.- Returns:
- Upper bound type of the current object in the context.
-
setUpperBoundType
Specifies the class name of the upper bound type of the current object in the context.- Parameters:
type- Upper bound type of the current object in the context.
-
getGetMethodName
Obtains the name of the method to get the value from the object in the current context.- Returns:
- Name of method.
-
setGetMethodName
Specifies the name of the method to get the value from the object in the current context.- Parameters:
getMethodName- Name of method.
-
getStaticValue
Obtains the static value for the element/attribute.- Returns:
- Static value for the element/attribute.
-
isUseRaw
public boolean isUseRaw()Indicates whether the value should be used raw or whether it should be transformed for XML (ie special characters substituted).- Returns:
- Flag indicate whether to use the raw value.
-
setIsUseRaw
Specifies whether the value should be used raw or whether it should be transformed for XML (ie special characters subsituted).- Parameters:
isUseRaw- Flag indicating whether to use the raw value.
-
getType
Obtains the type of this XML mapping.- Returns:
- Type of this XML mapping.
-
setType
Specifies the type of this XML mapping.- Parameters:
type- Type for this XML mapping.
-
getId
Obtains the Id for reference mapping.- Returns:
- Id for referencing.
-
setId
Specifies the Id for reference mapping.- Parameters:
id- Id for referencing.
-
loadObjectMappings
Loads the object mappings.- Parameters:
objectMappings- Object mappings.
-