use of org.openforis.idm.metamodel.NumericAttributeDefinition.Type in project collect by openforis.
the class NumericAttributeDefinitionPR method onStartDefinition.
@Override
protected void onStartDefinition() throws XmlParseException, XmlPullParserException, IOException {
super.onStartDefinition();
String typeStr = getAttribute(TYPE, false);
NumericAttributeDefinition defn = (NumericAttributeDefinition) getDefinition();
try {
Type type = typeStr == null ? Type.REAL : Type.valueOf(typeStr.toUpperCase());
defn.setType(type);
} catch (IllegalArgumentException e) {
throw new XmlParseException(getParser(), "unknown type " + typeStr);
}
}
use of org.openforis.idm.metamodel.NumericAttributeDefinition.Type in project collect by openforis.
the class NumericAttributeDefinitionFormObject method saveTo.
@Override
public void saveTo(T dest, String languageCode) {
super.saveTo(dest, languageCode);
Type typeEnum = null;
if (type != null) {
typeEnum = NumericAttributeDefinition.Type.valueOf(type);
}
dest.setType(typeEnum);
}
Aggregations