use of org.glassfish.api.admin.config.ModelBinding in project Payara by payara.
the class CommandModelImpl method add.
private static void add(Map<String, ParamModel> results, AnnotatedElement e, I18n parentI18n, LocalStringManager localStrings) {
Param param = e.getAnnotation(Param.class);
if (param != null) {
String defaultValue = param.defaultValue();
ModelBinding mb = e.getAnnotation(ModelBinding.class);
if (mb != null && defaultValue.isEmpty()) {
Method m = null;
try {
m = mb.type().getMethod(mb.getterMethodName());
} catch (NoSuchMethodException e1) {
// ignore.
}
if (m != null) {
Attribute attr = m.getAnnotation(Attribute.class);
if (attr != null) {
defaultValue = attr.defaultValue();
}
}
}
ParamModel model = new ParamModelImpl(e, defaultValue, parentI18n, localStrings);
if (!results.containsKey(model.getName())) {
results.put(model.getName(), model);
}
}
}
Aggregations