Class FlowDefinitionRegistryBuilder
java.lang.Object
org.springframework.webflow.config.FlowDefinitionRegistryBuilder
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
ConstructorDescriptionFlowDefinitionRegistryBuilder
(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 andFlowBuilderServices
. -
Method Summary
Modifier and TypeMethodDescriptionaddFlowBuilder
(FlowBuilder builder) Register a customFlowBuilder
instance.addFlowBuilder
(FlowBuilder builder, String id) Register a customFlowBuilder
instance with the given flow id.addFlowBuilder
(FlowBuilder builder, String id, Map<String, Object> attributes) Register a customFlowBuilder
instance with the given flow id.addFlowLocation
(String path) Register a flow defined at the following location as an .xml file.addFlowLocation
(String path, String id) Register a flow defined at the following location as an .xml file.Register a flow defined at the following location as an .xml file.addFlowLocationPattern
(String pattern) Registers a set of flows resolved from a resource location pattern.build()
Create and return aFlowDefinitionRegistry
instance.setBasePath
(String basePath) Configure the base path where flow definitions are found.setFlowBuilderServices
(FlowBuilderServices flowBuilderServices) Set theFlowBuilderServices
to use for defining custom services needed to build the flows registered in this registry.setParent
(FlowDefinitionRegistry parent) Configure a parent registry.
-
Constructor Details
-
FlowDefinitionRegistryBuilder
public FlowDefinitionRegistryBuilder(org.springframework.context.ApplicationContext appContext) Create a new instance with the given ApplicationContext.- Parameters:
appContext
- 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 andFlowBuilderServices
.- Parameters:
appContext
- the ApplicationContext to use for initializing the FlowDefinitionResourceFactory and FlowBuilderServices instances withbuilderServices
- aFlowBuilderServices
instance to configure on the FlowDefinitionRegistry
-
-
Method Details
-
setBasePath
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
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
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(String path, String id, Map<String, 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
Registers a set of flows resolved from a resource location pattern.- Parameters:
pattern
- the pattern to use
-
setFlowBuilderServices
public FlowDefinitionRegistryBuilder setFlowBuilderServices(FlowBuilderServices flowBuilderServices) Set theFlowBuilderServices
to use for defining custom services needed to build the flows registered in this registry.- Parameters:
flowBuilderServices
- theFlowBuilderServices
instance
-
addFlowBuilder
Register a customFlowBuilder
instance.- Parameters:
builder
- the FlowBuilder to configure
-
addFlowBuilder
Register a customFlowBuilder
instance with the given flow id.- Parameters:
builder
- the FlowBuilder to configureid
- 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, String id, Map<String, Object> attributes) Register a customFlowBuilder
instance with the given flow id.- Parameters:
builder
- the FlowBuilder to configureid
- 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
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
Create and return aFlowDefinitionRegistry
instance.
-