org.springframework.batch.core.configuration.xml

## Class SimpleFlowFactoryBean

- java.lang.Object
- - org.springframework.batch.core.configuration.xml.SimpleFlowFactoryBean

- All Implemented Interfaces:
    org.springframework.beans.factory.FactoryBean<SimpleFlow>, org.springframework.beans.factory.InitializingBean
  Direct Known Subclasses:
    JsrFlowFactoryBean

      public class SimpleFlowFactoryBean
      extends java.lang.Object
      implements org.springframework.beans.factory.FactoryBean<SimpleFlow>, org.springframework.beans.factory.InitializingBean

  Convenience factory for SimpleFlow instances for use in XML namespace. It replaces the states in the input with proxies that have a unique name formed from the flow name and the original state name (unless the name is already in that form, in which case it is not modified).
  Author:
    Dave Syer, Michael Minella

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `SimpleFlowFactoryBean.DelegateState` A State that proxies a delegate and changes its name but leaves its behavior unchanged.

  - ### Field Summary

    - ### Fields inherited from interface org.springframework.beans.factory.FactoryBean

      `OBJECT_TYPE_ATTRIBUTE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimpleFlowFactoryBean()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `afterPropertiesSet()` Check mandatory properties (name).
    `protected State` | `createNewStepState(State state, java.lang.String oldName, java.lang.String stateName)` Provides an extension point to provide alternative `StepState` implementations within a `SimpleFlow`
    `SimpleFlow` | `getObject()`
    `java.lang.Class<?>` | `getObjectType()`
    `boolean` | `isSingleton()`
    `void` | `setFlowType(java.lang.Class<SimpleFlow> flowType)`
    `void` | `setName(java.lang.String name)` The name of the flow that is created by this factory.
    `void` | `setStateTransitionComparator(java.util.Comparator<StateTransition> stateTransitionComparator)`
    `void` | `setStateTransitions(java.util.List<StateTransition> stateTransitions)` The raw state transitions for the flow.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SimpleFlowFactoryBean

          public SimpleFlowFactoryBean()

  - ### Method Detail

    - #### setStateTransitionComparator

          public void setStateTransitionComparator(java.util.Comparator<StateTransition> stateTransitionComparator)

      Parameters:
        `stateTransitionComparator` - `Comparator` implementation that addresses the ordering of state evaluation

    - #### setFlowType

          public void setFlowType(java.lang.Class<SimpleFlow> flowType)

      Parameters:
        `flowType` - Used to inject the type of flow (regular Spring Batch or JSR-352)

    - #### setName

          public void setName(java.lang.String name)

      The name of the flow that is created by this factory.
      Parameters:
        `name` - the value of the name

    - #### setStateTransitions

          public void setStateTransitions(java.util.List<StateTransition> stateTransitions)

      The raw state transitions for the flow. They will be transformed into proxies that have the same behavior but unique names prefixed with the flow name.
      Parameters:
        `stateTransitions` - the list of transitions

    - #### afterPropertiesSet

          public void afterPropertiesSet()
                                  throws java.lang.Exception

      Check mandatory properties (name).
      Specified by:
        `afterPropertiesSet` in interface `org.springframework.beans.factory.InitializingBean`
      Throws:
        `java.lang.Exception` - thrown if error occurs.

    - #### getObject

          public SimpleFlow getObject()
                               throws java.lang.Exception

      Specified by:
        `getObject` in interface `org.springframework.beans.factory.FactoryBean<SimpleFlow>`
      Throws:
        `java.lang.Exception`

    - #### createNewStepState

          protected State createNewStepState(State state,
                                             java.lang.String oldName,
                                             java.lang.String stateName)

      Provides an extension point to provide alternative `StepState` implementations within a `SimpleFlow`
      Parameters:
        `state` - The state that will be used to create the StepState
        `oldName` - The name to be replaced
        `stateName` - The name for the new State
      Returns:
        a state for the requested data

    - #### getObjectType

          public java.lang.Class<?> getObjectType()

      Specified by:
        `getObjectType` in interface `org.springframework.beans.factory.FactoryBean<SimpleFlow>`

    - #### isSingleton

          public boolean isSingleton()

      Specified by:
        `isSingleton` in interface `org.springframework.beans.factory.FactoryBean<SimpleFlow>`