Class XmlFlowModelBuilder

java.lang.Object
org.springframework.webflow.engine.model.builder.xml.XmlFlowModelBuilder
All Implemented Interfaces:
FlowModelBuilder

public class XmlFlowModelBuilder extends Object implements FlowModelBuilder
Builds a flow model from a XML-based flow definition resource.
Author:
Keith Donald, Scott Andrews, Rossen Stoyanchev
  • Constructor Summary

    Constructors
    Constructor
    Description
    XmlFlowModelBuilder(org.springframework.core.io.Resource resource)
    Create a new XML flow model builder that will parse the XML document at the specified resource location and use the provided locator to access parent flow models.
    XmlFlowModelBuilder(org.springframework.core.io.Resource resource, FlowModelLocator modelLocator)
    Create a new XML flow model builder that will parse the XML document at the specified resource location and use the provided locator to access parent flow models.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Builds any variables initialized by the flow when it starts.
    void
    Shutdown the builder, releasing any resources it holds.
    protected Document
    Returns the DOM document parsed from the XML file.
    protected Element
    Returns the root document element.
    Get the fully constructed flow model.
    org.springframework.core.io.Resource
    Get the underlying flow model resource accessed to build this flow model.
    boolean
    Returns true if the underlying flow model resource has changed since the last call to FlowModelBuilder.init().
    void
    Initialize this builder.
    void
    Sets the loader that will load the XML-based flow definition document.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • XmlFlowModelBuilder

      public XmlFlowModelBuilder(org.springframework.core.io.Resource resource)
      Create a new XML flow model builder that will parse the XML document at the specified resource location and use the provided locator to access parent flow models.
      Parameters:
      resource - the path to the XML flow definition (required)
    • XmlFlowModelBuilder

      public XmlFlowModelBuilder(org.springframework.core.io.Resource resource, FlowModelLocator modelLocator)
      Create a new XML flow model builder that will parse the XML document at the specified resource location and use the provided locator to access parent flow models.
      Parameters:
      resource - the path to the XML flow definition (required)
      modelLocator - a locator for parent flow models to support flow inheritance
  • Method Details

    • setDocumentLoader

      public void setDocumentLoader(DocumentLoader documentLoader)
      Sets the loader that will load the XML-based flow definition document. Optional, defaults to DefaultDocumentLoader.
      Parameters:
      documentLoader - the document loader
    • init

      public void init() throws FlowModelBuilderException
      Description copied from interface: FlowModelBuilder
      Initialize this builder. This could cause the builder to open a stream to an externalized resource representing the flow definition, for example.
      Specified by:
      init in interface FlowModelBuilder
      Throws:
      FlowModelBuilderException - an exception occurred building the flow
    • build

      public void build() throws FlowModelBuilderException
      Description copied from interface: FlowModelBuilder
      Builds any variables initialized by the flow when it starts.
      Specified by:
      build in interface FlowModelBuilder
      Throws:
      FlowModelBuilderException - an exception occurred building the flow
    • getFlowModel

      public FlowModel getFlowModel() throws FlowModelBuilderException
      Description copied from interface: FlowModelBuilder
      Get the fully constructed flow model. Called by the builder's assembler (director) after assembly. When this method is called by the assembler, it is expected flow construction has completed and the returned flow model is ready for use.
      Specified by:
      getFlowModel in interface FlowModelBuilder
      Throws:
      FlowModelBuilderException - an exception occurred building this flow
    • dispose

      public void dispose() throws FlowModelBuilderException
      Description copied from interface: FlowModelBuilder
      Shutdown the builder, releasing any resources it holds. A new flow construction process should start with another call to the FlowModelBuilder.init() method.
      Specified by:
      dispose in interface FlowModelBuilder
      Throws:
      FlowModelBuilderException - an exception occurred disposing this flow
    • getFlowModelResource

      public org.springframework.core.io.Resource getFlowModelResource()
      Description copied from interface: FlowModelBuilder
      Get the underlying flow model resource accessed to build this flow model. Returns null if this builder does not construct the flow model from a resource.
      Specified by:
      getFlowModelResource in interface FlowModelBuilder
      Returns:
      the flow model resource
    • hasFlowModelResourceChanged

      public boolean hasFlowModelResourceChanged()
      Description copied from interface: FlowModelBuilder
      Returns true if the underlying flow model resource has changed since the last call to FlowModelBuilder.init(). Always returns false if the flow model is not build from a resource.
      Specified by:
      hasFlowModelResourceChanged in interface FlowModelBuilder
      Returns:
      true if the resource backing the flow model has changed
    • getDocument

      protected Document getDocument()
      Returns the DOM document parsed from the XML file.
    • getDocumentElement

      protected Element getDocumentElement()
      Returns the root document element.
    • toString

      public String toString()
      Overrides:
      toString in class Object