}
userPref.setAttribute("name", m.getName());
userPref.setAttribute("datatype", dataType.value());
PreferenceAttributes attributes = m.getAnnotation(PreferenceAttributes.class);
if (attributes != null) {
GadgetUtils.writeAnnotationToElement(logger, attributes, userPref);
switch (attributes.options()) {
case HIDDEN:
userPref.setAttribute("datatype", "hidden");
break;
case NORMAL:
break;
case REQUIRED:
userPref.setAttribute("required", "true");
break;
default:
logger.log(TreeLogger.ERROR, "Unknown Option "
+ attributes.options().name(), null);
throw new UnableToCompleteException();
}
}
// Allow type-specific modifications to the userpref Element to be made