private InputModel parseInput(Element element) { InputModel input = new InputModel(element.getAttribute("name"), element.getAttribute("value")); input.setType(element.getAttribute("type")); input.setRequired(element.getAttribute("required")); return input; }
public void merge(Model model) { InputModel input = (InputModel) model; setValue(merge(getValue(), input.getValue())); setType(merge(getType(), input.getType())); setRequired(merge(getRequired(), input.getRequired())); }
public Model createCopy() { InputModel copy = new InputModel(getName(), getValue()); super.fillCopy(copy); return copy; } }
public void testMerge() { InputModel child = new InputModel("child", "childvalue"); InputModel parent = new InputModel("child", "parentvalue"); parent.setType("parenttype"); child.merge(parent); assertEquals("parenttype", child.getType()); }
private DefaultMapping parseSubflowInputMapping(InputModel input) { ExpressionParser parser = getLocalContext().getExpressionParser(); String name = input.getName(); String value = null; if (StringUtils.hasText(input.getValue())) { value = input.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(input, mapping); parseAndSetMappingRequired(input, mapping); return mapping; }
public void testNotMergeable() { InputModel child = new InputModel("child", "childvalue"); InputModel parent = new InputModel("parent", "parentvalue"); assertFalse(child.isMergeableWith(parent)); }
private DefaultMapping parseFlowInputMapping(InputModel input) { ExpressionParser parser = getLocalContext().getExpressionParser(); String name = input.getName(); String value = null; if (StringUtils.hasText(input.getValue())) { value = input.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(input, mapping); parseAndSetMappingRequired(input, mapping); return mapping; }
public void testNotMergeableWithNull() { InputModel child = new InputModel("child", "childvalue"); assertFalse(child.isMergeableWith(null)); }
public void merge(Model model) { InputModel input = (InputModel) model; setValue(merge(getValue(), input.getValue())); setType(merge(getType(), input.getType())); setRequired(merge(getRequired(), input.getRequired())); }
private InputModel parseInput(Element element) { InputModel input = new InputModel(element.getAttribute("name"), element.getAttribute("value")); input.setType(element.getAttribute("type")); input.setRequired(element.getAttribute("required")); return input; }
private DefaultMapping parseFlowInputMapping(InputModel input) { ExpressionParser parser = getLocalContext().getExpressionParser(); String name = input.getName(); String value = null; if (StringUtils.hasText(input.getValue())) { value = input.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(input, mapping); parseAndSetMappingRequired(input, mapping); return mapping; }
public Model createCopy() { InputModel copy = new InputModel(getName(), getValue()); super.fillCopy(copy); return copy; } }
public void testMergeable() { InputModel child = new InputModel("child", "childvalue"); assertTrue(child.isMergeableWith(child)); }
public void merge(Model model) { InputModel input = (InputModel) model; setValue(merge(getValue(), input.getValue())); setType(merge(getType(), input.getType())); setRequired(merge(getRequired(), input.getRequired())); }