use of org.glassfish.admin.amx.annotation.Param in project Payara by payara.
the class MBeanInfoSupport method parameterInfos.
public static MBeanParameterInfo[] parameterInfos(final Method method) {
final Class<?>[] sig = method.getParameterTypes();
final Annotation[][] paramAnnotations = method.getParameterAnnotations();
final MBeanParameterInfo[] infos = new MBeanParameterInfo[sig.length];
for (int i = 0; i < sig.length; ++i) {
final Class<?> paramClass = translatedType(sig[i]);
final Annotation[] annotations = paramAnnotations[i];
final Param p = getAnnotation(annotations, Param.class);
final String paramName = (p == null || p.name().length() == 0) ? ("p" + i) : p.name();
final Description d = getAnnotation(annotations, Description.class);
String description = "";
if (d != null && d.value().length() != 0) {
description = d.value();
}
final String type = paramClass.getName();
final MBeanParameterInfo info = new MBeanParameterInfo(paramName, type, description);
infos[i] = info;
}
return (infos);
}
Aggregations