org.springframework.webflow.config
Interface FlowBuilder

All Known Implementing Classes:
AbstractFlowBuilder, BaseFlowBuilder, XmlFlowBuilder

public interface FlowBuilder

Builder interface used to build flows.

Implementations should encapsulate flow construction logic, either for a specific kind of flow, for example, an EditUsersMasterFlowBuilder built in Java code, or a generic flow builder strategy, like the XmlFlowBuilder, for building flows from an XML-definition.

Flow builders are executed by the FlowFactoryBean, which acts as an assembler (director). This is the classic GoF Builder pattern.

Author:
Keith Donald, Erwin Vervaet
See Also:
AbstractFlowBuilder, XmlFlowBuilder, FlowFactoryBean

Method Summary
 void buildStates()
          Creates and adds all states to the flow built by this builder.
 void dispose()
          Shutdown the builder, releasing any resources it holds.
 Flow getResult()
          Get the fully constructed and configured Flow object - called by the builder's assembler (director) after assembly.
 Flow init()
          Initialize this builder and return a handle to the flow under construction.
 

Method Detail

init

Flow init()
          throws FlowBuilderException
Initialize this builder and return a handle to the flow under construction.

Note: the returned Flow handle is needed to avoid infinite loops in the build process. The returned flow object is still under construction and not yet ready for use. The only property that is guaranteed to be filled is the id of the flow.

Returns:
the initialized (but yet to be built) flow
Throws:
FlowBuilderException - an exception occured building the flow

buildStates

void buildStates()
                 throws FlowBuilderException
Creates and adds all states to the flow built by this builder.

Throws:
FlowBuilderException - an exception occured building the flow

getResult

Flow getResult()
Get the fully constructed and configured Flow object - called by the builder's assembler (director) after assembly. Note that this method will return the same Flow object as that returned from the init() method. However, when this method is called by the assembler, flow construction will have completed and the returned flow is ready for use.


dispose

void dispose()
Shutdown the builder, releasing any resources it holds. A new flow construction process should start with another call to the init() method.



Copyright © 2005. All Rights Reserved.