@Override public String getName() { String name = super.getName(); return (name != null) ? name : Util.methodNameToAttributeName(this.accessible.getName()); }
public static String getPropertyName(Method method) throws IllegalArgumentException { if (method == null) { throw new IllegalArgumentException("Cannot get property name: field is null") ; } Property annotation=method.getAnnotation(Property.class); if (annotation == null) { throw new IllegalArgumentException("Cannot get property name for method " + method.getName() + " which is not annotated with @Property") ; } String propertyName=!annotation.name().isEmpty()? annotation.name() : method.getName(); propertyName=Util.methodNameToAttributeName(propertyName); return propertyName ; }
name = Util.methodNameToAttributeName(method.getName());
method_name=method_name.trim(); else { String field_name=Util.methodNameToAttributeName(method.getName()); method_name=Util.attributeNameToMethodName(field_name); try { Object value=method.invoke(obj); String attributeName=Util.methodNameToAttributeName(method_name); if(value instanceof Double) value=String.format("%.2f", (double)value);
if(annotation.name() != null) possible_names.add(annotation.name()); possible_names.add(Util.methodNameToAttributeName(methodName)); Field field=Util.findField(prot, possible_names); if(field != null) {
if(annotation.name() != null) possible_names.add(annotation.name()); possible_names.add(Util.methodNameToAttributeName(methodName)); Field field=Util.findField(prot, possible_names); if(field != null) {
final String name; if (annotation.name().length() < 1) { name = Util.methodNameToAttributeName(method.getName()); } else { name = annotation.name();
else { attr_name=Util.methodNameToAttributeName(methodName); if(!atts.containsKey(attr_name)) { String type=is_setter? method.getParameterTypes()[0].getCanonicalName() : method.getReturnType().getCanonicalName(); MBeanAttributeInfo info=new MBeanAttributeInfo(attr_name, type, descr, true, writable, methodName.startsWith("is")); AttributeEntry entry=new AttributeEntry(Util.methodNameToAttributeName(methodName), info); if(is_setter) entry.setter(new MethodAccessor(method, instance));
@Override public String getName() { String name = super.getName(); return (name != null) ? name : Util.methodNameToAttributeName(this.accessible.getName()); }
@Override public String getName() { String name = super.getName(); return (name != null) ? name : Util.methodNameToAttributeName(this.accessible.getName()); }
public static String getPropertyName(Method method) throws IllegalArgumentException { if (method == null) { throw new IllegalArgumentException("Cannot get property name: field is null") ; } Property annotation=method.getAnnotation(Property.class); if (annotation == null) { throw new IllegalArgumentException("Cannot get property name for method " + method.getName() + " which is not annotated with @Property") ; } String propertyName=!annotation.name().isEmpty()? annotation.name() : method.getName(); propertyName=Util.methodNameToAttributeName(propertyName); return propertyName ; }
name = Util.methodNameToAttributeName(method.getName());
method_name=method_name.trim(); else { String field_name=Util.methodNameToAttributeName(method.getName()); method_name=Util.attributeNameToMethodName(field_name); try { Object value=method.invoke(obj); String attributeName=Util.methodNameToAttributeName(method_name); if(value instanceof Double) value=String.format("%.2f", (double)value);
if(annotation.name() != null) possible_names.add(annotation.name()); possible_names.add(Util.methodNameToAttributeName(methodName)); Field field=Util.findField(prot, possible_names); if(field != null) {
if(annotation.name() != null) possible_names.add(annotation.name()); possible_names.add(Util.methodNameToAttributeName(methodName)); Field field=Util.findField(prot, possible_names); if(field != null) {
final String name; if (annotation.name().length() < 1) { name = Util.methodNameToAttributeName(method.getName()); } else { name = annotation.name();
else { attr_name=Util.methodNameToAttributeName(methodName); if(!atts.containsKey(attr_name)) { String type=is_setter? method.getParameterTypes()[0].getCanonicalName() : method.getReturnType().getCanonicalName(); MBeanAttributeInfo info=new MBeanAttributeInfo(attr_name, type, descr, true, writable, methodName.startsWith("is")); AttributeEntry entry=new AttributeEntry(Util.methodNameToAttributeName(methodName), info); if(is_setter) entry.setter(new MethodAccessor(method, instance));