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
ConstructorsConstructorDescriptionXmlFlowModelBuilder(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 TypeMethodDescriptionvoidbuild()Builds any variables initialized by the flow when it starts.voiddispose()Shutdown the builder, releasing any resources it holds.protected DocumentReturns the DOM document parsed from the XML file.protected ElementReturns the root document element.Get the fully constructed flow model.org.springframework.core.io.ResourceGet the underlying flow model resource accessed to build this flow model.booleanReturns true if the underlying flow model resource has changed since the last call toFlowModelBuilder.init().voidinit()Initialize this builder.voidsetDocumentLoader(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:FlowModelBuilderInitialize this builder. This could cause the builder to open a stream to an externalized resource representing the flow definition, for example.- Specified by:
initin interfaceFlowModelBuilder- Throws:
FlowModelBuilderException- an exception occurred building the flow
-
build
Description copied from interface:FlowModelBuilderBuilds any variables initialized by the flow when it starts.- Specified by:
buildin interfaceFlowModelBuilder- Throws:
FlowModelBuilderException- an exception occurred building the flow
-
getFlowModel
Description copied from interface:FlowModelBuilderGet 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:
getFlowModelin interfaceFlowModelBuilder- Throws:
FlowModelBuilderException- an exception occurred building this flow
-
dispose
Description copied from interface:FlowModelBuilderShutdown the builder, releasing any resources it holds. A new flow construction process should start with another call to theFlowModelBuilder.init()method.- Specified by:
disposein interfaceFlowModelBuilder- Throws:
FlowModelBuilderException- an exception occurred disposing this flow
-
getFlowModelResource
public org.springframework.core.io.Resource getFlowModelResource()Description copied from interface:FlowModelBuilderGet 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:
getFlowModelResourcein interfaceFlowModelBuilder- Returns:
- the flow model resource
-
hasFlowModelResourceChanged
public boolean hasFlowModelResourceChanged()Description copied from interface:FlowModelBuilderReturns 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:
hasFlowModelResourceChangedin 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
-