Example usage for org.apache.commons.beanutils IntrospectionContext getPropertyDescriptor

List of usage examples for org.apache.commons.beanutils IntrospectionContext getPropertyDescriptor

Introduction

In this page you can find the example usage for org.apache.commons.beanutils IntrospectionContext getPropertyDescriptor.

Prototype

PropertyDescriptor getPropertyDescriptor(String name);

Source Link

Document

Returns the descriptor for the property with the given name or null if this property is unknown.

Usage

From source file:org.apache.activemq.artemis.utils.uri.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;
            }//w w w  .  j  av a  2  s.co  m
            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);
            }
        }
    }
}