Class FlowParser

  • All Implemented Interfaces:
    org.springframework.beans.factory.xml.BeanDefinitionParser

    public class FlowParser
    extends AbstractFlowParser
    Parses flows as defined in JSR-352. The current state parses a flow as it is within a regular Spring Batch job/flow.
    Since:
    3.0
    Author:
    Michael Minella, Chris Schaefer
    • Constructor Summary

      Constructors 
      ConstructorDescription
      FlowParser​(java.lang.String flowName, java.lang.String jobFactoryRef) 
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      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 restart, java.lang.String exitCode, org.springframework.beans.factory.config.BeanDefinition stateDef, org.springframework.beans.factory.xml.ParserContext parserContext, boolean abandon) 
      protected voiddoParse​(org.w3c.dom.Element element, org.springframework.beans.factory.xml.ParserContext parserContext, org.springframework.beans.factory.support.BeanDefinitionBuilder builder) 
      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, java.lang.String stepId, 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, org.springframework.beans.factory.config.BeanDefinition stateDef, org.w3c.dom.Element element) 
      protected static java.util.Collection<org.springframework.beans.factory.config.BeanDefinition>parseTransitionElement​(org.w3c.dom.Element transitionElement, java.lang.String stateId, org.springframework.beans.factory.config.BeanDefinition stateDef, 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
    • Constructor Detail

      • FlowParser

        public FlowParser​(java.lang.String flowName,
                          java.lang.String jobFactoryRef)
        Parameters:
        flowName - The name of the flow
        jobFactoryRef - The bean name for the job factory
    • Method Detail

      • 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 AbstractFlowParser
        Parameters:
        element - the top level element containing a flow definition
        parserContext - the ParserContext
      • 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)
      • 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)
      • parseTransitionElement

        protected static java.util.Collection<org.springframework.beans.factory.config.BeanDefinition> parseTransitionElement​(org.w3c.dom.Element transitionElement,
                                                                                                                              java.lang.String stateId,
                                                                                                                              org.springframework.beans.factory.config.BeanDefinition stateDef,
                                                                                                                              org.springframework.beans.factory.xml.ParserContext parserContext)
      • 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 restart,
                                                                                                                        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.
        restart - The restart attribute this transition will set.
        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 state this transition will set.
        Returns:
        a collection of StateTransition references