Class FlowDefinitionRegistryBuilder

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

public class FlowDefinitionRegistryBuilder extends 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 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 and FlowBuilderServices.
      Parameters:
      appContext - the ApplicationContext to use for initializing the FlowDefinitionResourceFactory and FlowBuilderServices instances with
      builderServices - a FlowBuilderServices instance to configure on the FlowDefinitionRegistry
  • Method Details

    • setBasePath

      public FlowDefinitionRegistryBuilder setBasePath(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(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(String path, 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(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

      public FlowDefinitionRegistryBuilder addFlowLocationPattern(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, 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, String id, Map<String,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

      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.