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

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

Introduction

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

Prototype

void addPropertyDescriptor(PropertyDescriptor desc);

Source Link

Document

Adds the given property descriptor to this context.

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;
            }/*from ww w.  j  a  v  a 2 s.  c  om*/
            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);
            }
        }
    }
}