Class XmlFlowModelBuilder
java.lang.Object
org.springframework.webflow.engine.model.builder.xml.XmlFlowModelBuilder
- All Implemented Interfaces:
FlowModelBuilder
Builds a flow model from a XML-based flow definition resource.
- Author:
- Keith Donald, Scott Andrews, Rossen Stoyanchev
-
Constructor Summary
ConstructorDescriptionXmlFlowModelBuilder
(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 TypeMethodDescriptionvoid
build()
Builds any variables initialized by the flow when it starts.void
dispose()
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 toFlowModelBuilder.init()
.void
init()
Initialize this builder.void
setDocumentLoader
(DocumentLoader documentLoader) Sets the loader that will load the XML-based flow definition document.toString()
-
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
Sets the loader that will load the XML-based flow definition document. Optional, defaults toDefaultDocumentLoader
.- Parameters:
documentLoader
- the document loader
-
init
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 interfaceFlowModelBuilder
- Throws:
FlowModelBuilderException
- an exception occurred building the flow
-
build
Description copied from interface:FlowModelBuilder
Builds any variables initialized by the flow when it starts.- Specified by:
build
in interfaceFlowModelBuilder
- Throws:
FlowModelBuilderException
- an exception occurred building the flow
-
getFlowModel
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 interfaceFlowModelBuilder
- Throws:
FlowModelBuilderException
- an exception occurred building this flow
-
dispose
Description copied from interface:FlowModelBuilder
Shutdown the builder, releasing any resources it holds. A new flow construction process should start with another call to theFlowModelBuilder.init()
method.- Specified by:
dispose
in interfaceFlowModelBuilder
- 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 interfaceFlowModelBuilder
- 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 toFlowModelBuilder.init()
. Always returns false if the flow model is not build from a resource.- Specified by:
hasFlowModelResourceChanged
in interfaceFlowModelBuilder
- Returns:
- true if the resource backing the flow model has changed
-
getDocument
Returns the DOM document parsed from the XML file. -
getDocumentElement
Returns the root document element. -
toString
-