java.lang.Object
net.officefloor.plugin.xml.unmarshall.tree.XmlState

public class XmlState extends Object
State of the XML unmarshalling.
Author:
Daniel Sagenschneider
  • Field Details

    • initialContext

      protected final XmlContext initialContext
      Initial XmlContext in which to unmarshall.
    • contextStack

      protected final Stack<net.officefloor.plugin.xml.unmarshall.tree.XmlContextState> contextStack
      Stack of previous XmlContext.
    • currentContext

      protected XmlContext currentContext
      Current XmlContext in which to unmarshall.
    • currentTargetObject

      protected Object currentTargetObject
      Current target object.
    • endElementName

      protected String endElementName
      XML element name to end the current context.
  • Constructor Details

    • XmlState

      public XmlState(XmlContext initialContext)
      Initiate with the initial XmlContext.
      Parameters:
      initialContext - Initial XmlContext in which to unmarshall.
  • Method Details

    • setTargetObject

      public void setTargetObject(Object targetObject)
      Specifies the current target object.
      Parameters:
      targetObject - Target object.
    • reset

      public void reset()
      Resets the state.
    • getCurrentContext

      public XmlContext getCurrentContext()
      Obtains the current XmlContext.
      Returns:
      Current XmlContext.
    • getCurrentTargetObject

      public Object getCurrentTargetObject()
      Obtains the current target object.
      Returns:
      Target object to load values/objects.
    • getEndElementName

      public 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(String elementName, Object targetObject, XmlContext context)
      Makes the input target object and XmlContext the current for XML unmarshalling.
      Parameters:
      elementName - Name of the element/attribute.
      targetObject - Target object.
      context - New XmlContext.
    • popContext

      public void popContext() throws XmlMarshallException
      Pops the previous XmlContext off the stack and makes it the current XmlContext for XML unmarshalling.
      Throws:
      XmlMarshallException - If there is no previous XmlContext.