for (CheckExport export : exports) {
String variableId = export.getName();
org.mitre.oval.xmlSchema.ovalDefinitions5.VariableType defVariable = ovalResolver.getVariable(variableId);
VariableType variable = variablesType.addNewVariable();
if (defVariable != null) {
variable.setDatatype(defVariable.getDatatype());
} else {
// TODO: P3: handle simple and complex type
switch (export.getType()) {
case BOOLEAN:
variable.setDatatype(SimpleDatatypeEnumeration.BOOLEAN);
break;
case NUMBER:
case STRING:
default:
variable.setDatatype(SimpleDatatypeEnumeration.STRING);
break;
}
}
variable.setId(variableId);
for (String s : export.getValues()) {
variable.addNewValue().setStringValue(s);
}
variable.setComment("");
}
return retval;
}