Class AbstractFlowBuilder
java.lang.Object
org.springframework.webflow.engine.builder.support.AbstractFlowBuilder
- All Implemented Interfaces:
FlowBuilder
- Direct Known Subclasses:
FlowModelFlowBuilder
Abstract base implementation of a flow builder defining common functionality needed by most concrete flow builder
implementations. This class implements all optional parts of the FlowBuilder process as no-op methods. Subclasses are
only required to implement
buildStates()
.- Author:
- Keith Donald, Erwin Vervaet
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Builds any end actions to execute when the flow ends.void
Creates and adds all exception handlers to the flow built by this builder.void
Builds any transitions shared by all states of the flow.void
Builds the input mapper responsible for mapping flow input on start.void
Builds the output mapper responsible for mapping flow output on end.void
Builds any start actions to execute when the flow starts.abstract void
Builds the states of the flow.void
Builds any variables initialized by the flow when it starts.protected Flow
Factory method that initially creates the flow implementation during flow builder initialization.void
dispose()
Shutdown the builder, releasing any resources it holds.protected void
Flow builder destruction hook.protected void
doInit()
Flow builder initialization hook.protected FlowBuilderContext
Returns this flow builder's context.getFlow()
Get the fully constructed and configured Flow object.Returns a string describing the location of the flow resource; the logical location where the source code can be found.boolean
As the underlying flow managed by this builder changed since the last build occurred?void
init
(FlowBuilderContext context) Initialize this builder.
-
Constructor Details
-
AbstractFlowBuilder
public AbstractFlowBuilder()
-
-
Method Details
-
init
Description copied from interface:FlowBuilder
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 interfaceFlowBuilder
- Parameters:
context
- the flow builder context- Throws:
FlowBuilderException
- an exception occurred building the flow
-
doInit
protected void doInit()Flow builder initialization hook. Does nothing by default. May be overridden by subclasses. -
createFlow
Factory method that initially creates the flow implementation during flow builder initialization. Simply delegates to the configured flow artifact factory by default.- Returns:
- the flow instance, initially created but not yet built
-
getContext
Returns this flow builder's context.- Returns:
- the flow builder context
-
buildVariables
Description copied from interface:FlowBuilder
Builds any variables initialized by the flow when it starts.- Specified by:
buildVariables
in interfaceFlowBuilder
- Throws:
FlowBuilderException
- an exception occurred building the flow
-
buildInputMapper
Description copied from interface:FlowBuilder
Builds the input mapper responsible for mapping flow input on start.- Specified by:
buildInputMapper
in interfaceFlowBuilder
- Throws:
FlowBuilderException
- an exception occurred building the flow
-
buildStartActions
Description copied from interface:FlowBuilder
Builds any start actions to execute when the flow starts.- Specified by:
buildStartActions
in interfaceFlowBuilder
- Throws:
FlowBuilderException
- an exception occurred building the flow
-
buildStates
Description copied from interface:FlowBuilder
Builds the states of the flow.- Specified by:
buildStates
in interfaceFlowBuilder
- Throws:
FlowBuilderException
- an exception occurred building the flow
-
buildGlobalTransitions
Description copied from interface:FlowBuilder
Builds any transitions shared by all states of the flow.- Specified by:
buildGlobalTransitions
in interfaceFlowBuilder
- Throws:
FlowBuilderException
- an exception occurred building the flow
-
buildEndActions
Description copied from interface:FlowBuilder
Builds any end actions to execute when the flow ends.- Specified by:
buildEndActions
in interfaceFlowBuilder
- Throws:
FlowBuilderException
- an exception occurred building the flow
-
buildOutputMapper
Description copied from interface:FlowBuilder
Builds the output mapper responsible for mapping flow output on end.- Specified by:
buildOutputMapper
in interfaceFlowBuilder
- Throws:
FlowBuilderException
- an exception occurred building the flow
-
buildExceptionHandlers
Description copied from interface:FlowBuilder
Creates and adds all exception handlers to the flow built by this builder.- Specified by:
buildExceptionHandlers
in interfaceFlowBuilder
- Throws:
FlowBuilderException
- an exception occurred building this flow
-
getFlow
Description copied from interface:FlowBuilder
Get the fully constructed and configured Flow object. 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 is fully configured and ready for use.- Specified by:
getFlow
in interfaceFlowBuilder
- Throws:
FlowBuilderException
- an exception occurred building this flow
-
dispose
Description copied from interface:FlowBuilder
Shutdown the builder, releasing any resources it holds. A new flow construction process should start with another call to theFlowBuilder.init(FlowBuilderContext)
method.- Specified by:
dispose
in interfaceFlowBuilder
- Throws:
FlowBuilderException
- an exception occurred building this flow
-
hasFlowChanged
public boolean hasFlowChanged()Description copied from interface:FlowBuilder
As the underlying flow managed by this builder changed since the last build occurred?- Specified by:
hasFlowChanged
in interfaceFlowBuilder
- Returns:
- true if changed, false if not
-
getFlowResourceString
Description copied from interface:FlowBuilder
Returns a string describing the location of the flow resource; the logical location where the source code can be found. Used for informational purposes.- Specified by:
getFlowResourceString
in interfaceFlowBuilder
- Returns:
- the flow resource string
-
doDispose
protected void doDispose()Flow builder destruction hook. Does nothing by default. May be overridden by subclasses.
-