/** Create Variables from parsed OvalVariables. */ Variables(OvalVariables vars) throws OvalException { this(); List<VariableType> varList = vars.getVariables().getVariable(); int len = varList.size(); for (int i = 0; i < len; i++) { VariableType vt = varList.get(i); variables.put(vt.getId(), extractValue(vt)); } }
public OvalVariables getOvalVariables() { OvalVariables vars = Factories.variables.createOvalVariables(); vars.setGenerator(OvalFactory.getGenerator()); VariablesType vt = Factories.variables.createVariablesType(); for (String key : variables.keySet()) { VariableType var = Factories.variables.createVariableType(); var.setId(key); for (IType t : variables.get(key)) { var.getValue().add(t.getString()); } String comment = comments.get(key); if (comment != null) { var.setComment(comment); } vt.getVariable().add(var); } vars.setVariables(vt); return vars; }