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

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

Introduction

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

Prototype

Class<?> getTargetClass();

Source Link

Document

Returns the class that is subject of introspection.

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 w w  w .  jav  a2 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);
            }
        }
    }
}