class SplitParser {

	private static final String PARENT_ATTR = "parent";

	private final String jobFactoryRef;

	/**
	 * Construct a {@link InlineFlowParser} by using the provided job repository
	 * reference.
	 * @param jobFactoryRef The reference to the {@link JobParserJobFactoryBean} from the
	 * enclosing tag.
	 */
	public SplitParser(String jobFactoryRef) {
		this.jobFactoryRef = jobFactoryRef;
	}

	/**
	 * Parse the split and turn it into a list of transitions.
	 * @param element The &lt;split/gt; element to parse
	 * @param parserContext The parser context for the bean factory
	 * @return a collection of bean definitions for
	 * {@link org.springframework.batch.core.job.flow.support.StateTransition} instances
	 * objects
	 */
	public Collection<BeanDefinition> parse(Element element, ParserContext parserContext) {<FILL_FUNCTION_BODY>}

}


		String idAttribute = element.getAttribute("id");

		BeanDefinitionBuilder stateBuilder = BeanDefinitionBuilder
			.genericBeanDefinition("org.springframework.batch.core.job.flow.support.state.SplitState");

		String taskExecutorBeanId = element.getAttribute("task-executor");
		if (StringUtils.hasText(taskExecutorBeanId)) {
			RuntimeBeanReference taskExecutorRef = new RuntimeBeanReference(taskExecutorBeanId);
			stateBuilder.addPropertyValue("taskExecutor", taskExecutorRef);
		}

		List<Element> flowElements = DomUtils.getChildElementsByTagName(element, "flow");

		if (flowElements.size() < 2) {
			parserContext.getReaderContext().error("A <split/> must contain at least two 'flow' elements.", element);
		}

		Collection<BeanDefinition> flows = new ManagedList<>();
		int i = 0;
		String prefix = idAttribute;
		for (Element nextElement : flowElements) {
			String ref = nextElement.getAttribute(PARENT_ATTR);
			if (StringUtils.hasText(ref)) {
				if (nextElement.getElementsByTagName("*").getLength() > 0) {
					parserContext.getReaderContext()
						.error("A <flow/> in a <split/> must have ref= or nested <flow/>, but not both.", nextElement);
				}
				AbstractBeanDefinition flowDefinition = new GenericBeanDefinition();
				flowDefinition.setParentName(ref);
				MutablePropertyValues propertyValues = flowDefinition.getPropertyValues();
				propertyValues.addPropertyValue("name", prefix + "." + i);
				flows.add(flowDefinition);
			}
			else {
				InlineFlowParser flowParser = new InlineFlowParser(prefix + "." + i, jobFactoryRef);
				flows.add(flowParser.parse(nextElement, parserContext));
			}
			i++;
		}

		stateBuilder.addConstructorArgValue(flows);
		stateBuilder.addConstructorArgValue(prefix);

		return InlineFlowParser.getNextElements(parserContext, stateBuilder.getBeanDefinition(), element);

	
<no_super_class>