private OutputModel parseOutput(Element element) { OutputModel output = new OutputModel(element.getAttribute("name"), element.getAttribute("value")); output.setType(element.getAttribute("type")); output.setRequired(element.getAttribute("required")); return output; }
public void merge(Model model) { OutputModel output = (OutputModel) model; setValue(merge(getValue(), output.getValue())); setType(merge(getType(), output.getType())); setRequired(merge(getRequired(), output.getRequired())); }
public Model createCopy() { OutputModel copy = new OutputModel(getName(), getValue()); super.fillCopy(copy); return copy; }
public void testMerge() { OutputModel child = new OutputModel("child", "childvalue"); OutputModel parent = new OutputModel("child", "parentvalue"); parent.setType("parenttype"); child.merge(parent); assertEquals("parenttype", child.getType()); }
private DefaultMapping parseFlowOutputMapping(OutputModel output) { ExpressionParser parser = getLocalContext().getExpressionParser(); String name = output.getName(); String value = null; if (StringUtils.hasText(output.getValue())) { value = output.getValue(); } else { value = name; } Expression source = parser.parseExpression(value, new FluentParserContext().evaluate(RequestContext.class)); Expression target = parser.parseExpression(name, new FluentParserContext().evaluate(MutableAttributeMap.class)); DefaultMapping mapping = new DefaultMapping(source, target); parseAndSetMappingConversionExecutor(output, mapping); parseAndSetMappingRequired(output, mapping); return mapping; }
public void testMerge() { EndStateModel child = new EndStateModel("child"); EndStateModel parent = new EndStateModel("child"); parent.setCommit("true"); parent.setView("view"); LinkedList<OutputModel> outputs = new LinkedList<>(); outputs.add(new OutputModel("foo", "bar")); parent.setOutputs(outputs); child.merge(parent); assertEquals("true", child.getCommit()); assertEquals("bar", child.getOutputs().get(0).getValue()); } }
public void testNotMergeable() { OutputModel child = new OutputModel("child", "childvalue"); OutputModel parent = new OutputModel("parent", "parentvalue"); assertFalse(child.isMergeableWith(parent)); }
private DefaultMapping parseSubflowOutputMapping(OutputModel output) { ExpressionParser parser = getLocalContext().getExpressionParser(); String name = output.getName(); String value = null; if (StringUtils.hasText(output.getValue())) { value = output.getValue(); } else { value = "flowScope." + name; } Expression source = parser.parseExpression(name, new FluentParserContext().evaluate(MutableAttributeMap.class)); Expression target = parser.parseExpression(value, new FluentParserContext().evaluate(RequestContext.class)); DefaultMapping mapping = new DefaultMapping(source, target); parseAndSetMappingConversionExecutor(output, mapping); parseAndSetMappingRequired(output, mapping); return mapping; }
public void testNotMergeableWithNull() { OutputModel child = new OutputModel("child", "childvalue"); assertFalse(child.isMergeableWith(null)); }
public void merge(Model model) { OutputModel output = (OutputModel) model; setValue(merge(getValue(), output.getValue())); setType(merge(getType(), output.getType())); setRequired(merge(getRequired(), output.getRequired())); }
private OutputModel parseOutput(Element element) { OutputModel output = new OutputModel(element.getAttribute("name"), element.getAttribute("value")); output.setType(element.getAttribute("type")); output.setRequired(element.getAttribute("required")); return output; }
private DefaultMapping parseSubflowOutputMapping(OutputModel output) { ExpressionParser parser = getLocalContext().getExpressionParser(); String name = output.getName(); String value = null; if (StringUtils.hasText(output.getValue())) { value = output.getValue(); } else { value = "flowScope." + name; } Expression source = parser.parseExpression(name, new FluentParserContext().evaluate(MutableAttributeMap.class)); Expression target = parser.parseExpression(value, new FluentParserContext().evaluate(RequestContext.class)); DefaultMapping mapping = new DefaultMapping(source, target); parseAndSetMappingConversionExecutor(output, mapping); parseAndSetMappingRequired(output, mapping); return mapping; }
public Model createCopy() { OutputModel copy = new OutputModel(getName(), getValue()); super.fillCopy(copy); return copy; }
public void testMergeable() { OutputModel child = new OutputModel("child", "childvalue"); assertTrue(child.isMergeableWith(child)); }