org.springframework.batch.core.configuration.xml
Class FlowParser

java.lang.Object
  extended by org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
      extended by org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
          extended by org.springframework.batch.core.configuration.xml.FlowParser
All Implemented Interfaces:
BeanDefinitionParser

public class FlowParser
extends AbstractSingleBeanDefinitionParser

Author:
Dave Syer

Field Summary
 
Fields inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
ID_ATTRIBUTE
 
Constructor Summary
FlowParser(String flowName, String jobFactoryRef)
          Construct a FlowParser with the specified name and using the provided job repository ref.
 
Method Summary
protected  void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder)
           
protected  Class<SimpleFlow> getBeanClass(Element element)
           
protected static Collection<BeanDefinition> getNextElements(ParserContext parserContext, BeanDefinition stateDef, Element element)
           
protected static Collection<BeanDefinition> getNextElements(ParserContext parserContext, String stepId, BeanDefinition stateDef, Element element)
           
static BeanDefinition getStateTransitionReference(ParserContext parserContext, BeanDefinition stateDefinition, String on, String next)
           
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlowParser

public FlowParser(String flowName,
                  String jobFactoryRef)
Construct a FlowParser with the specified name and using the provided job repository ref.

Parameters:
flowName - the name of the flow
jobFactoryRef - the reference to the JobParserJobFactoryBean from the enclosing tag
Method Detail

getBeanClass

protected Class<SimpleFlow> getBeanClass(Element element)
Overrides:
getBeanClass in class AbstractSingleBeanDefinitionParser

doParse

protected void doParse(Element element,
                       ParserContext parserContext,
                       BeanDefinitionBuilder builder)
Overrides:
doParse in class AbstractSingleBeanDefinitionParser
Parameters:
element - the top level element containing a flow definition
parserContext - the ParserContext

getNextElements

protected static Collection<BeanDefinition> getNextElements(ParserContext parserContext,
                                                            BeanDefinition stateDef,
                                                            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

protected static Collection<BeanDefinition> getNextElements(ParserContext parserContext,
                                                            String stepId,
                                                            BeanDefinition stateDef,
                                                            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

getStateTransitionReference

public static BeanDefinition getStateTransitionReference(ParserContext parserContext,
                                                         BeanDefinition stateDefinition,
                                                         String on,
                                                         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


Copyright © 2009 SpringSource. All Rights Reserved.