Class XmlState
java.lang.Object
net.officefloor.plugin.xml.unmarshall.tree.XmlState
State of the XML unmarshalling.
- Author:
- Daniel Sagenschneider
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Stack<net.officefloor.plugin.xml.unmarshall.tree.XmlContextState>Stack of previousXmlContext.protected XmlContextCurrentXmlContextin which to unmarshall.protected ObjectCurrent target object.protected StringXML element name to end the current context.protected final XmlContextInitialXmlContextin which to unmarshall. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionObtains the currentXmlContext.Obtains the current target object.Obtains the XML element name to end the current context.voidPops the previousXmlContextoff the stack and makes it the currentXmlContextfor XML unmarshalling.voidpushContext(String elementName, Object targetObject, XmlContext context) Makes the input target object andXmlContextthe current for XML unmarshalling.voidreset()Resets the state.voidsetTargetObject(Object targetObject) Specifies the current target object.
-
Field Details
-
initialContext
InitialXmlContextin which to unmarshall. -
contextStack
Stack of previousXmlContext. -
currentContext
CurrentXmlContextin which to unmarshall. -
currentTargetObject
Current target object. -
endElementName
XML element name to end the current context.
-
-
Constructor Details
-
XmlState
Initiate with the initialXmlContext.- Parameters:
initialContext- InitialXmlContextin which to unmarshall.
-
-
Method Details
-
setTargetObject
Specifies the current target object.- Parameters:
targetObject- Target object.
-
reset
public void reset()Resets the state. -
getCurrentContext
Obtains the currentXmlContext.- Returns:
- Current
XmlContext.
-
getCurrentTargetObject
Obtains the current target object.- Returns:
- Target object to load values/objects.
-
getEndElementName
Obtains the XML element name to end the current context.- Returns:
- XML element name to end the current context.
-
pushContext
Makes the input target object andXmlContextthe current for XML unmarshalling.- Parameters:
elementName- Name of the element/attribute.targetObject- Target object.context- NewXmlContext.
-
popContext
Pops the previousXmlContextoff the stack and makes it the currentXmlContextfor XML unmarshalling.- Throws:
XmlMarshallException- If there is no previousXmlContext.
-