Class XmlState
- java.lang.Object
-
- net.officefloor.plugin.xml.unmarshall.tree.XmlState
-
public class XmlState extends java.lang.Object
State of the XML unmarshalling.- Author:
- Daniel Sagenschneider
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Stack<net.officefloor.plugin.xml.unmarshall.tree.XmlContextState>
contextStack
Stack of previousXmlContext
.protected XmlContext
currentContext
CurrentXmlContext
in which to unmarshall.protected java.lang.Object
currentTargetObject
Current target object.protected java.lang.String
endElementName
XML element name to end the current context.protected XmlContext
initialContext
InitialXmlContext
in which to unmarshall.
-
Constructor Summary
Constructors Constructor Description XmlState(XmlContext initialContext)
Initiate with the initialXmlContext
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XmlContext
getCurrentContext()
Obtains the currentXmlContext
.java.lang.Object
getCurrentTargetObject()
Obtains the current target object.java.lang.String
getEndElementName()
Obtains the XML element name to end the current context.void
popContext()
Pops the previousXmlContext
off the stack and makes it the currentXmlContext
for XML unmarshalling.void
pushContext(java.lang.String elementName, java.lang.Object targetObject, XmlContext context)
Makes the input target object andXmlContext
the current for XML unmarshalling.void
reset()
Resets the state.void
setTargetObject(java.lang.Object targetObject)
Specifies the current target object.
-
-
-
Field Detail
-
initialContext
protected final XmlContext initialContext
InitialXmlContext
in which to unmarshall.
-
contextStack
protected final java.util.Stack<net.officefloor.plugin.xml.unmarshall.tree.XmlContextState> contextStack
Stack of previousXmlContext
.
-
currentContext
protected XmlContext currentContext
CurrentXmlContext
in which to unmarshall.
-
currentTargetObject
protected java.lang.Object currentTargetObject
Current target object.
-
endElementName
protected java.lang.String endElementName
XML element name to end the current context.
-
-
Constructor Detail
-
XmlState
public XmlState(XmlContext initialContext)
Initiate with the initialXmlContext
.- Parameters:
initialContext
- InitialXmlContext
in which to unmarshall.
-
-
Method Detail
-
setTargetObject
public void setTargetObject(java.lang.Object targetObject)
Specifies the current target object.- Parameters:
targetObject
- Target object.
-
reset
public void reset()
Resets the state.
-
getCurrentContext
public XmlContext getCurrentContext()
Obtains the currentXmlContext
.- Returns:
- Current
XmlContext
.
-
getCurrentTargetObject
public java.lang.Object getCurrentTargetObject()
Obtains the current target object.- Returns:
- Target object to load values/objects.
-
getEndElementName
public java.lang.String getEndElementName()
Obtains the XML element name to end the current context.- Returns:
- XML element name to end the current context.
-
pushContext
public void pushContext(java.lang.String elementName, java.lang.Object targetObject, XmlContext context)
Makes the input target object andXmlContext
the current for XML unmarshalling.- Parameters:
elementName
- Name of the element/attribute.targetObject
- Target object.context
- NewXmlContext
.
-
popContext
public void popContext() throws XmlMarshallException
Pops the previousXmlContext
off the stack and makes it the currentXmlContext
for XML unmarshalling.- Throws:
XmlMarshallException
- If there is no previousXmlContext
.
-
-