org.springframework.batch.core.configuration.xml

## Class AbstractFlowParser

- java.lang.Object
- - org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
  - - org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
    - - org.springframework.batch.core.configuration.xml.AbstractFlowParser

- All Implemented Interfaces:
    org.springframework.beans.factory.xml.BeanDefinitionParser
  Direct Known Subclasses:
    FlowParser, InlineFlowParser, TopLevelFlowParser

      public abstract class AbstractFlowParser
      extends org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser

  Author:
    Dave Syer, Michael Minella, Chris Schaefer

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static java.lang.String` | `DECISION_ELE`
    `protected static java.lang.String` | `END_ELE`
    `protected static int` | `endCounter`
    `protected static java.lang.String` | `EXIT_CODE_ATTR`
    `protected static java.lang.String` | `FAIL_ELE`
    `protected static java.lang.String` | `FLOW_ELE`
    `protected static java.lang.String` | `ID_ATTR`
    `protected static java.lang.String` | `NEXT_ATTR`
    `protected static java.lang.String` | `NEXT_ELE`
    `protected static java.lang.String` | `ON_ATTR`
    `protected static java.lang.String` | `RESTART_ATTR`
    `protected static java.lang.String` | `SPLIT_ELE`
    `protected static java.lang.String` | `STEP_ELE`
    `protected static java.lang.String` | `STOP_ELE`
    `protected static java.lang.String` | `TO_ATTR`

    - ### Fields inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser

      `ID_ATTRIBUTE, NAME_ATTRIBUTE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractFlowParser()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected static java.util.Collection<org.springframework.beans.factory.config.BeanDefinition>` | `createTransition(FlowExecutionStatus status, java.lang.String on, java.lang.String next, java.lang.String exitCode, org.springframework.beans.factory.config.BeanDefinition stateDef, org.springframework.beans.factory.xml.ParserContext parserContext, boolean abandon)`
    `protected void` | `doParse(org.w3c.dom.Element element, org.springframework.beans.factory.xml.ParserContext parserContext, org.springframework.beans.factory.support.BeanDefinitionBuilder builder)`
    `protected void` | `findAllReachableElements(java.lang.String startElement, java.util.Map<java.lang.String,java.util.Set<java.lang.String>> reachableElementMap, java.util.Set<java.lang.String> accumulator)` Find all of the elements reachable from the startElement.
    `protected static FlowExecutionStatus` | `getBatchStatusFromEndTransitionName(java.lang.String elementName)`
    `protected java.lang.Class<?>` | `getBeanClass(org.w3c.dom.Element element)`
    `static java.util.Collection<org.springframework.beans.factory.config.BeanDefinition>` | `getNextElements(org.springframework.beans.factory.xml.ParserContext parserContext, org.springframework.beans.factory.config.BeanDefinition stateDef, org.w3c.dom.Element element)`
    `static java.util.Collection<org.springframework.beans.factory.config.BeanDefinition>` | `getNextElements(org.springframework.beans.factory.xml.ParserContext parserContext, java.lang.String stepId, org.springframework.beans.factory.config.BeanDefinition stateDef, org.w3c.dom.Element element)`
    `static org.springframework.beans.factory.config.BeanDefinition` | `getStateTransitionReference(org.springframework.beans.factory.xml.ParserContext parserContext, org.springframework.beans.factory.config.BeanDefinition stateDefinition, java.lang.String on, java.lang.String next)`
    `protected void` | `setJobFactoryRef(java.lang.String jobFactoryRef)` Convenience method for subclasses to set the job factory reference if it is available (null is fine, but the quality of error reports is better if it is available).
    `protected static void` | `verifyUniquePattern(org.w3c.dom.Element transitionElement, java.util.List<java.lang.String> patterns, org.w3c.dom.Element element, org.springframework.beans.factory.xml.ParserContext parserContext)`

    - ### Methods inherited from class org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser

      `doParse, getBeanClassName, getParentName, parseInternal`

    - ### Methods inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser

      `parse, postProcessComponentDefinition, registerBeanDefinition, resolveId, shouldFireEvents, shouldGenerateId, shouldGenerateIdAsFallback, shouldParseNameAsAliases`

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

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

- - ### Field Detail

    - #### ID_ATTR

          protected static final java.lang.String ID_ATTR

      See Also:
        Constant Field Values

    - #### STEP_ELE

          protected static final java.lang.String STEP_ELE

      See Also:
        Constant Field Values

    - #### FLOW_ELE

          protected static final java.lang.String FLOW_ELE

      See Also:
        Constant Field Values

    - #### DECISION_ELE

          protected static final java.lang.String DECISION_ELE

      See Also:
        Constant Field Values

    - #### SPLIT_ELE

          protected static final java.lang.String SPLIT_ELE

      See Also:
        Constant Field Values

    - #### NEXT_ATTR

          protected static final java.lang.String NEXT_ATTR

      See Also:
        Constant Field Values

    - #### NEXT_ELE

          protected static final java.lang.String NEXT_ELE

      See Also:
        Constant Field Values

    - #### END_ELE

          protected static final java.lang.String END_ELE

      See Also:
        Constant Field Values

    - #### FAIL_ELE

          protected static final java.lang.String FAIL_ELE

      See Also:
        Constant Field Values

    - #### STOP_ELE

          protected static final java.lang.String STOP_ELE

      See Also:
        Constant Field Values

    - #### ON_ATTR

          protected static final java.lang.String ON_ATTR

      See Also:
        Constant Field Values

    - #### TO_ATTR

          protected static final java.lang.String TO_ATTR

      See Also:
        Constant Field Values

    - #### RESTART_ATTR

          protected static final java.lang.String RESTART_ATTR

      See Also:
        Constant Field Values

    - #### EXIT_CODE_ATTR

          protected static final java.lang.String EXIT_CODE_ATTR

      See Also:
        Constant Field Values

    - #### endCounter

          protected static int endCounter

  - ### Constructor Detail

    - #### AbstractFlowParser

          public AbstractFlowParser()

  - ### Method Detail

    - #### setJobFactoryRef

          protected void setJobFactoryRef(java.lang.String jobFactoryRef)

      Convenience method for subclasses to set the job factory reference if it is available (null is fine, but the quality of error reports is better if it is available).
      Parameters:
        `jobFactoryRef` - name of the ref

    - #### getBeanClass

          protected java.lang.Class<?> getBeanClass(org.w3c.dom.Element element)

      Overrides:
        `getBeanClass` in class `org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser`

    - #### doParse

          protected void doParse(org.w3c.dom.Element element,
                                 org.springframework.beans.factory.xml.ParserContext parserContext,
                                 org.springframework.beans.factory.support.BeanDefinitionBuilder builder)

      Overrides:
        `doParse` in class `org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser`
      Parameters:
        `element` - the top level element containing a flow definition
        `parserContext` - the `ParserContext`

    - #### findAllReachableElements

          protected void findAllReachableElements(java.lang.String startElement,
                                                  java.util.Map<java.lang.String,java.util.Set<java.lang.String>> reachableElementMap,
                                                  java.util.Set<java.lang.String> accumulator)

      Find all of the elements reachable from the startElement.
      Parameters:
        `startElement` - name of the element to start from
        `reachableElementMap` - Map of elements that can be reached from the startElement
        `accumulator` - a collection of reachable element names

    - #### getNextElements

          public static java.util.Collection<org.springframework.beans.factory.config.BeanDefinition> getNextElements(org.springframework.beans.factory.xml.ParserContext parserContext,
                                                                                                                      org.springframework.beans.factory.config.BeanDefinition stateDef,
                                                                                                                      org.w3c.dom.Element element)

      Parameters:
        `parserContext` - the parser context for the bean factory
        `stateDef` - The bean definition for the current state
        `element` - the <step/gt; element to parse
      Returns:
        a collection of `StateTransition` references

    - #### getNextElements

          public static java.util.Collection<org.springframework.beans.factory.config.BeanDefinition> getNextElements(org.springframework.beans.factory.xml.ParserContext parserContext,
                                                                                                                      java.lang.String stepId,
                                                                                                                      org.springframework.beans.factory.config.BeanDefinition stateDef,
                                                                                                                      org.w3c.dom.Element element)

      Parameters:
        `parserContext` - the parser context for the bean factory
        `stepId` - the id of the current state if it is a step state, null otherwise
        `stateDef` - The bean definition for the current state
        `element` - the <step/gt; element to parse
      Returns:
        a collection of `StateTransition` references

    - #### verifyUniquePattern

          protected static void verifyUniquePattern(org.w3c.dom.Element transitionElement,
                                                    java.util.List<java.lang.String> patterns,
                                                    org.w3c.dom.Element element,
                                                    org.springframework.beans.factory.xml.ParserContext parserContext)

      Parameters:
        `transitionElement` - The element to parse
        `patterns` - a list of patterns on state transitions for this element
        `element` - `Element` representing the source.
        `parserContext` - the parser context for the bean factory

    - #### createTransition

          protected static java.util.Collection<org.springframework.beans.factory.config.BeanDefinition> createTransition(FlowExecutionStatus status,
                                                                                                                          java.lang.String on,
                                                                                                                          java.lang.String next,
                                                                                                                          java.lang.String exitCode,
                                                                                                                          org.springframework.beans.factory.config.BeanDefinition stateDef,
                                                                                                                          org.springframework.beans.factory.xml.ParserContext parserContext,
                                                                                                                          boolean abandon)

      Parameters:
        `status` - The batch status that this transition will set. Use BatchStatus.UNKNOWN if not applicable.
        `on` - The pattern that this transition should match. Use null for "no restriction" (same as "*").
        `next` - The state to which this transition should go. Use null if not applicable.
        `exitCode` - The exit code that this transition will set. Use null to default to batchStatus.
        `stateDef` - The bean definition for the current state
        `parserContext` - the parser context for the bean factory
        `abandon` - the abandon flag to be used by the transition.
      Returns:
        a collection of `StateTransition` references

    - #### getBatchStatusFromEndTransitionName

          protected static FlowExecutionStatus getBatchStatusFromEndTransitionName(java.lang.String elementName)

      Parameters:
        `elementName` - An end transition element name
      Returns:
        the BatchStatus corresponding to the transition name

    - #### getStateTransitionReference

          public static org.springframework.beans.factory.config.BeanDefinition getStateTransitionReference(org.springframework.beans.factory.xml.ParserContext parserContext,
                                                                                                            org.springframework.beans.factory.config.BeanDefinition stateDefinition,
                                                                                                            java.lang.String on,
                                                                                                            java.lang.String next)

      Parameters:
        `parserContext` - the parser context
        `stateDefinition` - a reference to the state implementation
        `on` - the pattern value
        `next` - the next step id
      Returns:
        a bean definition for a `StateTransition`