/** {@inheritDoc} */ @Override protected String getDescription(MBeanInfo info) { String str = super.getDescription(info); // Return either default one or given by annotation. MXBeanDescription desc = U.getAnnotation(getMBeanInterface(), MXBeanDescription.class); if (desc != null) { str = desc.value(); assert str != null; assert !str.trim().isEmpty(); // Enforce proper English. assert Character.isUpperCase(str.charAt(0)) == true : str; assert str.charAt(str.length() - 1) == '.' : str; } return str; }
/** {@inheritDoc} */ @Override protected String getDescription(MBeanOperationInfo info) { String str = super.getDescription(info); try { Method m = getMethod(info); MXBeanDescription desc = m.getAnnotation(MXBeanDescription.class); if (desc != null) { str = desc.value(); assert str != null; assert !str.trim().isEmpty(); // Enforce proper English. assert Character.isUpperCase(str.charAt(0)) == true : str; assert str.charAt(str.length() - 1) == '.' : str; } } catch (SecurityException | ClassNotFoundException ignored) { // No-op. Default value will be returned. } return str; }
/** {@inheritDoc} */ @Override protected String getDescription(MBeanAttributeInfo info) { String str = super.getDescription(info); String methodName = (info.isIs() ? "is" : "get") + info.getName(); try { // Recursively get method. Method mtd = findMethod(getMBeanInterface(), methodName, new Class[]{}); if (mtd != null) { MXBeanDescription desc = mtd.getAnnotation(MXBeanDescription.class); if (desc != null) { str = desc.value(); assert str != null : "Failed to find method: " + mtd; assert !str.trim().isEmpty() : "Method description cannot be empty: " + mtd; // Enforce proper English. assert Character.isUpperCase(str.charAt(0)) == true : "Description must start with upper case: " + str; assert str.charAt(str.length() - 1) == '.' : "Description must end with period: " + str; } } } catch (SecurityException ignored) { // No-op. Default value will be returned. } return str; }
/** {@inheritDoc} */ @Override protected String getDescription(MBeanInfo info) { String str = super.getDescription(info); // Return either default one or given by annotation. MXBeanDescription desc = U.getAnnotation(getMBeanInterface(), MXBeanDescription.class); if (desc != null) { str = desc.value(); assert str != null; assert !str.trim().isEmpty(); // Enforce proper English. assert Character.isUpperCase(str.charAt(0)) == true : str; assert str.charAt(str.length() - 1) == '.' : str; } return str; }
/** {@inheritDoc} */ @Override protected String getDescription(MBeanOperationInfo info) { String str = super.getDescription(info); try { Method m = getMethod(info); MXBeanDescription desc = m.getAnnotation(MXBeanDescription.class); if (desc != null) { str = desc.value(); assert str != null; assert !str.trim().isEmpty(); // Enforce proper English. assert Character.isUpperCase(str.charAt(0)) == true : str; assert str.charAt(str.length() - 1) == '.' : str; } } catch (SecurityException | ClassNotFoundException ignored) { // No-op. Default value will be returned. } return str; }
/** {@inheritDoc} */ @Override protected String getDescription(MBeanAttributeInfo info) { String str = super.getDescription(info); String methodName = (info.isIs() ? "is" : "get") + info.getName(); try { // Recursively get method. Method mtd = findMethod(getMBeanInterface(), methodName, new Class[]{}); if (mtd != null) { MXBeanDescription desc = mtd.getAnnotation(MXBeanDescription.class); if (desc != null) { str = desc.value(); assert str != null : "Failed to find method: " + mtd; assert !str.trim().isEmpty() : "Method description cannot be empty: " + mtd; // Enforce proper English. assert Character.isUpperCase(str.charAt(0)) == true : "Description must start with upper case: " + str; assert str.charAt(str.length() - 1) == '.' : "Description must end with period: " + str; } } } catch (SecurityException ignored) { // No-op. Default value will be returned. } return str; }