Java 类org.apache.commons.beanutils.IntrospectionContext 实例源码

项目:activemq-artemis    文件:FluentPropertyBeanIntrospectorWithIgnores.java   
@Override
public void introspect(IntrospectionContext icontext) throws IntrospectionException {
   for (Method m : icontext.getTargetClass().getMethods()) {
      if (m.getName().startsWith(getWriteMethodPrefix())) {
         String propertyName = propertyName(m);
         PropertyDescriptor pd = icontext.getPropertyDescriptor(propertyName);

         if (isIgnored(icontext.getTargetClass().getName(), m.getName())) {
            logger.trace(m.getName() + " Ignored for " + icontext.getTargetClass().getName());
            continue;
         }
         try {
            if (pd == null) {
               icontext.addPropertyDescriptor(createFluentPropertyDescritor(m, propertyName));
            } else if (pd.getWriteMethod() == null) {
               pd.setWriteMethod(m);
            }
         } catch (IntrospectionException e) {
            logger.debug(e.getMessage(), e);
         }
      }
   }
}
项目:prometheus-metrics-agent    文件:GenericClassIntrospector.java   
@Override
public void introspect(IntrospectionContext icontext) {

    for (final Method m : icontext.getTargetClass().getMethods()) {

        if (isValidValueMethod(m)) {
            try {
                icontext.addPropertyDescriptor(new PropertyDescriptor(m.getName(), m, null));
            } catch (final IntrospectionException e) {
                LOGGER.info("Error when creating PropertyDescriptor for " + m + "! Ignoring this property.");
                LOGGER.log(FINE, "Exception is:", e);
            }
        }
    }
}
项目:metrics-agent    文件:GenericClassIntrospector.java   
@Override
public void introspect(IntrospectionContext icontext) {

    for (final Method m : icontext.getTargetClass().getMethods()) {

        if (isValidValueMethod(m)) {
            try {
                icontext.addPropertyDescriptor(new PropertyDescriptor(m.getName(), m, null));
            } catch (final IntrospectionException e) {
                LOGGER.info("Error when creating PropertyDescriptor for " + m + "! Ignoring this property.");
                LOGGER.log(FINE, "Exception is:", e);
            }
        }
    }
}