MetadataMBeanInfoAssembler.java 文件源码

java
阅读 21 收藏 0 点赞 0 评论 0

项目:lams 作者:
/**
 * Retrieves the description for the supplied {@code Method} from the
 * metadata. Uses the method name is no description is present in the metadata.
 */
@Override
protected String getOperationDescription(Method method, String beanKey) {
    PropertyDescriptor pd = BeanUtils.findPropertyForMethod(method);
    if (pd != null) {
        ManagedAttribute ma = this.attributeSource.getManagedAttribute(method);
        if (ma != null && StringUtils.hasText(ma.getDescription())) {
            return ma.getDescription();
        }
        ManagedMetric metric = this.attributeSource.getManagedMetric(method);
        if (metric != null && StringUtils.hasText(metric.getDescription())) {
            return metric.getDescription();
        }
        return method.getName();
    }
    else {
        ManagedOperation mo = this.attributeSource.getManagedOperation(method);
        if (mo != null && StringUtils.hasText(mo.getDescription())) {
            return mo.getDescription();
        }
        return method.getName();
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号