@Override public void writeXML(final Document document, final org.w3c.dom.Element currentElement, final String outputFolder) { org.w3c.dom.Element xmlVariable = document.createElement(XML_TAG_NAME); super.writeXML(xmlVariable) ; RandomNumberVariable theVariable = (RandomNumberVariable) variable; xmlVariable.setAttribute(XML_ATTR_MIN_VAL, Integer.toString(theVariable.getMinValue())); xmlVariable.setAttribute(XML_ATTR_MAX_VAL, Integer.toString(theVariable.getMaxValue())); currentElement.appendChild(xmlVariable); }
private void from(Object object) { if (object instanceof Variable) { Variable instance = (Variable) object; name(instance.getName()); Optional<Variable.VariableNoValuesLeftBehavior> noValuesLeftBehaviorOptional = instance.getNoValuesLeftBehavior(); if (noValuesLeftBehaviorOptional.isPresent()) { noValuesLeftBehavior(noValuesLeftBehaviorOptional); } Optional<String> descriptionOptional = instance.getDescription(); if (descriptionOptional.isPresent()) { description(descriptionOptional); } scope(instance.getScope()); Optional<Variable.VariableOrder> orderOptional = instance.getOrder(); if (orderOptional.isPresent()) { order(orderOptional); } policy(instance.getPolicy()); } if (object instanceof RandomNumberVariable) { RandomNumberVariable instance = (RandomNumberVariable) object; minValue(instance.getMinValue()); maxValue(instance.getMaxValue()); } }