spring-webflow

org.springframework.webflow.config
Class FlowDefinitionRegistryBuilder

java.lang.Object
  extended by org.springframework.webflow.config.FlowDefinitionRegistryBuilder

public class FlowDefinitionRegistryBuilder
extends java.lang.Object

A builder for creating FlowDefinitionRegistry instances designed for programmatic use in @Bean factory methods. For XML configuration consider using the webflow-config XML namespace.

Since:
2.4
Author:
Rossen Stoyanchev

Constructor Summary
FlowDefinitionRegistryBuilder(org.springframework.context.ApplicationContext appContext)
          Create a new instance with the given ApplicationContext.
FlowDefinitionRegistryBuilder(org.springframework.context.ApplicationContext appContext, FlowBuilderServices builderServices)
          Create a new instance with the given ApplicationContext and FlowBuilderServices.
 
Method Summary
 FlowDefinitionRegistryBuilder addFlowBuilder(FlowBuilder builder)
          Register a custom FlowBuilder instance.
 FlowDefinitionRegistryBuilder addFlowBuilder(FlowBuilder builder, java.lang.String id)
          Register a custom FlowBuilder instance with the given flow id.
 FlowDefinitionRegistryBuilder addFlowBuilder(FlowBuilder builder, java.lang.String id, java.util.Map<java.lang.String,java.lang.Object> attributes)
          Register a custom FlowBuilder instance with the given flow id.
 FlowDefinitionRegistryBuilder addFlowLocation(java.lang.String path)
          Register a flow defined at the following location as an .xml file.
 FlowDefinitionRegistryBuilder addFlowLocation(java.lang.String path, java.lang.String id)
          Register a flow defined at the following location as an .xml file.
 FlowDefinitionRegistryBuilder addFlowLocation(java.lang.String path, java.lang.String id, java.util.Map<java.lang.String,java.lang.Object> attributes)
          Register a flow defined at the following location as an .xml file.
 FlowDefinitionRegistryBuilder addFlowLocationPattern(java.lang.String pattern)
          Registers a set of flows resolved from a resource location pattern.
 FlowDefinitionRegistry build()
          Create and return a FlowDefinitionRegistry instance.
 FlowDefinitionRegistryBuilder setBasePath(java.lang.String basePath)
          Configure the base path where flow definitions are found.
 FlowDefinitionRegistryBuilder setFlowBuilderServices(FlowBuilderServices flowBuilderServices)
          Set the FlowBuilderServices to use for defining custom services needed to build the flows registered in this registry.
 FlowDefinitionRegistryBuilder setParent(FlowDefinitionRegistry parent)
          Configure a parent registry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlowDefinitionRegistryBuilder

public FlowDefinitionRegistryBuilder(org.springframework.context.ApplicationContext appContext)
Create a new instance with the given ApplicationContext.

Parameters:
applicationContext - the ApplicationContext to use for initializing the FlowDefinitionResourceFactory and FlowBuilderServices instances with

FlowDefinitionRegistryBuilder

public FlowDefinitionRegistryBuilder(org.springframework.context.ApplicationContext appContext,
                                     FlowBuilderServices builderServices)
Create a new instance with the given ApplicationContext and FlowBuilderServices.

Parameters:
applicationContext - the ApplicationContext to use for initializing the FlowDefinitionResourceFactory and FlowBuilderServices instances with
builderServices - a FlowBuilderServices instance to configure on the FlowDefinitionRegistry
Method Detail

setBasePath

public FlowDefinitionRegistryBuilder setBasePath(java.lang.String basePath)
Configure the base path where flow definitions are found. When specified, all flow locations are relative to this path. Also when specified, by default flows are assigned an id equal to the the path segment between their base path and file name.

For example, if a flow definition is located at '/WEB-INF/hotels/booking/booking-flow.xml' and the base path is '/WEB-INF', the remaining path to this flow is 'hotels/booking' which then becomes the flow id.

If a flow definition is found directly on the base path, the file name minus its extension is used as the flow id.

Parameters:
basePath - the base path to use

addFlowLocation

public FlowDefinitionRegistryBuilder addFlowLocation(java.lang.String path)
Register a flow defined at the following location as an .xml file. This may be a path to a single resource or a ANT-style path expression that matches multiple resources.

Parameters:
path - the resource path to the externalized flow definition resource.

addFlowLocation

public FlowDefinitionRegistryBuilder addFlowLocation(java.lang.String path,
                                                     java.lang.String id)
Register a flow defined at the following location as an .xml file. This may be a path to a single resource or a ANT-style path expression that matches multiple resources.

Parameters:
path - the resource path to the externalized flow definition resource.
id - the unique id to assign to the added flow definition in the registry Specify only if you wish to provide a custom flow definition identifier.

addFlowLocation

public FlowDefinitionRegistryBuilder addFlowLocation(java.lang.String path,
                                                     java.lang.String id,
                                                     java.util.Map<java.lang.String,java.lang.Object> attributes)
Register a flow defined at the following location as an .xml file. This may be a path to a single resource or a ANT-style path expression that matches multiple resources.

Parameters:
path - the resource path to the externalized flow definition resource.
id - the unique id to assign to the added flow definition in the registry Specify only if you wish to provide a custom flow definition identifier.
attributes - meta-attributes to assign to the flow definition

addFlowLocationPattern

public FlowDefinitionRegistryBuilder addFlowLocationPattern(java.lang.String pattern)
Registers a set of flows resolved from a resource location pattern.

Parameters:
pattern - the pattern to use

setFlowBuilderServices

public FlowDefinitionRegistryBuilder setFlowBuilderServices(FlowBuilderServices flowBuilderServices)
Set the FlowBuilderServices to use for defining custom services needed to build the flows registered in this registry.

Parameters:
flowBuilderServices - the FlowBuilderServices instance

addFlowBuilder

public FlowDefinitionRegistryBuilder addFlowBuilder(FlowBuilder builder)
Register a custom FlowBuilder instance.

Parameters:
builder - the FlowBuilder to configure

addFlowBuilder

public FlowDefinitionRegistryBuilder addFlowBuilder(FlowBuilder builder,
                                                    java.lang.String id)
Register a custom FlowBuilder instance with the given flow id.

Parameters:
builder - the FlowBuilder to configure
id - the id assign to the flow definition in this registry. Specify when you wish to provide a custom flow definition identifier.

addFlowBuilder

public FlowDefinitionRegistryBuilder addFlowBuilder(FlowBuilder builder,
                                                    java.lang.String id,
                                                    java.util.Map<java.lang.String,java.lang.Object> attributes)
Register a custom FlowBuilder instance with the given flow id.

Parameters:
builder - the FlowBuilder to configure
id - the id assign to the flow definition in this registry. Specify when you wish to provide a custom flow definition identifier.
attributes - attributes to assign to the flow definition.

setParent

public FlowDefinitionRegistryBuilder setParent(FlowDefinitionRegistry parent)
Configure a parent registry. Registries can be organized in a hierarchy. If a child registry does not contain a flow, its parent registry is queried.

Parameters:
parent - the parent registry

build

public FlowDefinitionRegistry build()
Create and return a FlowDefinitionRegistry instance.


spring-webflow