Class XmlState
- java.lang.Object
-
- net.officefloor.plugin.xml.unmarshall.tree.XmlState
-
public class XmlState extends java.lang.ObjectState 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>contextStackStack of previousXmlContext.protected XmlContextcurrentContextCurrentXmlContextin which to unmarshall.protected java.lang.ObjectcurrentTargetObjectCurrent target object.protected java.lang.StringendElementNameXML element name to end the current context.protected XmlContextinitialContextInitialXmlContextin 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 XmlContextgetCurrentContext()Obtains the currentXmlContext.java.lang.ObjectgetCurrentTargetObject()Obtains the current target object.java.lang.StringgetEndElementName()Obtains the XML element name to end the current context.voidpopContext()Pops the previousXmlContextoff the stack and makes it the currentXmlContextfor XML unmarshalling.voidpushContext(java.lang.String elementName, java.lang.Object targetObject, XmlContext context)Makes the input target object andXmlContextthe current for XML unmarshalling.voidreset()Resets the state.voidsetTargetObject(java.lang.Object targetObject)Specifies the current target object.
-
-
-
Field Detail
-
initialContext
protected final XmlContext initialContext
InitialXmlContextin which to unmarshall.
-
contextStack
protected final java.util.Stack<net.officefloor.plugin.xml.unmarshall.tree.XmlContextState> contextStack
Stack of previousXmlContext.
-
currentContext
protected XmlContext currentContext
CurrentXmlContextin 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- InitialXmlContextin 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 andXmlContextthe current for XML unmarshalling.- Parameters:
elementName- Name of the element/attribute.targetObject- Target object.context- NewXmlContext.
-
popContext
public void popContext() throws XmlMarshallExceptionPops the previousXmlContextoff the stack and makes it the currentXmlContextfor XML unmarshalling.- Throws:
XmlMarshallException- If there is no previousXmlContext.
-
-