private List<FlowBuilderInfo> parseFlowBuilders(Element element) { List<Element> builderElements = DomUtils.getChildElementsByTagName(element, "flow-builder"); if (builderElements.isEmpty()) { return Collections.emptyList(); } List<FlowBuilderInfo> builders = new ArrayList<>(builderElements.size()); for (Element builderElement : builderElements) { String id = builderElement.getAttribute("id"); String className = builderElement.getAttribute("class"); builders.add(new FlowBuilderInfo(id, className, parseAttributes(builderElement))); } return builders; }
private FlowDefinition buildFlowDefinition(FlowBuilderInfo builderInfo) { try { Class<?> flowBuilderClass = loadClass(builderInfo.getClassName()); FlowBuilder builder = (FlowBuilder) flowBuilderClass.newInstance(); AttributeMap<Object> flowAttributes = getFlowAttributes(builderInfo.getAttributes()); FlowBuilderContext builderContext = new FlowBuilderContextImpl(builderInfo.getId(), flowAttributes, flowRegistry, flowBuilderServices); FlowAssembler assembler = new FlowAssembler(builder, builderContext); return assembler.assembleFlow(); } catch (IllegalArgumentException e) { throw new FlowDefinitionConstructionException(builderInfo.getId(), e); } catch (InstantiationException e) { throw new FlowDefinitionConstructionException(builderInfo.getId(), e); } catch (IllegalAccessException e) { throw new FlowDefinitionConstructionException(builderInfo.getId(), e); } }
public FlowBuilderInfo(String id, String className, Set<FlowElementAttribute> attributes) { Assert.hasText(className, "The fully-qualified FlowBuilder class name is required"); this.className = className; setId(id); this.attributes = (attributes != null ? attributes : Collections.emptySet()); }
private FlowDefinition buildFlowDefinition(FlowBuilderInfo builderInfo) { try { Class<?> flowBuilderClass = loadClass(builderInfo.getClassName()); FlowBuilder builder = (FlowBuilder) flowBuilderClass.newInstance(); AttributeMap<Object> flowAttributes = getFlowAttributes(builderInfo.getAttributes()); FlowBuilderContext builderContext = new FlowBuilderContextImpl(builderInfo.getId(), flowAttributes, flowRegistry, flowBuilderServices); FlowAssembler assembler = new FlowAssembler(builder, builderContext); return assembler.assembleFlow(); } catch (IllegalArgumentException e) { throw new FlowDefinitionConstructionException(builderInfo.getId(), e); } catch (InstantiationException e) { throw new FlowDefinitionConstructionException(builderInfo.getId(), e); } catch (IllegalAccessException e) { throw new FlowDefinitionConstructionException(builderInfo.getId(), e); } }
private List<FlowBuilderInfo> parseFlowBuilders(Element element) { List<Element> builderElements = DomUtils.getChildElementsByTagName(element, "flow-builder"); if (builderElements.isEmpty()) { return Collections.emptyList(); } List<FlowBuilderInfo> builders = new ArrayList<>(builderElements.size()); for (Element builderElement : builderElements) { String id = builderElement.getAttribute("id"); String className = builderElement.getAttribute("class"); builders.add(new FlowBuilderInfo(id, className, parseAttributes(builderElement))); } return builders; }
public FlowBuilderInfo(String id, String className, Set attributes) { Assert.hasText(className, "The fully-qualified FlowBuilder class name is required"); this.className = className; setId(id); this.attributes = (attributes != null ? attributes : Collections.EMPTY_SET); }
private FlowDefinition buildFlowDefinition(FlowBuilderInfo builderInfo) { try { Class flowBuilderClass = loadClass(builderInfo.getClassName()); FlowBuilder builder = (FlowBuilder) flowBuilderClass.newInstance(); AttributeMap flowAttributes = getFlowAttributes(builderInfo.getAttributes()); FlowBuilderContext builderContext = new FlowBuilderContextImpl(builderInfo.getId(), flowAttributes, flowRegistry, flowBuilderServices); FlowAssembler assembler = new FlowAssembler(builder, builderContext); return assembler.assembleFlow(); } catch (IllegalArgumentException e) { throw new FlowDefinitionConstructionException(builderInfo.getId(), e); } catch (InstantiationException e) { throw new FlowDefinitionConstructionException(builderInfo.getId(), e); } catch (IllegalAccessException e) { throw new FlowDefinitionConstructionException(builderInfo.getId(), e); } }
private List parseFlowBuilders(Element element) { List builderElements = DomUtils.getChildElementsByTagName(element, "flow-builder"); if (builderElements.isEmpty()) { return Collections.EMPTY_LIST; } List builders = new ArrayList(builderElements.size()); for (Iterator it = builderElements.iterator(); it.hasNext();) { Element builderElement = (Element) it.next(); String id = builderElement.getAttribute("id"); String className = builderElement.getAttribute("class"); builders.add(new FlowBuilderInfo(id, className, parseAttributes(builderElement))); } return builders; }
public FlowBuilderInfo(String id, String className, Set<FlowElementAttribute> attributes) { Assert.hasText(className, "The fully-qualified FlowBuilder class name is required"); this.className = className; setId(id); this.attributes = (attributes != null ? attributes : Collections.emptySet()); }