Example usage for org.apache.commons.beanutils.expression Resolver isMapped

List of usage examples for org.apache.commons.beanutils.expression Resolver isMapped

Introduction

In this page you can find the example usage for org.apache.commons.beanutils.expression Resolver isMapped.

Prototype

boolean isMapped(String expression);

Source Link

Document

Indicate whether the expression is for a mapped property or not.

Usage

From source file:nl.ucan.navigate.NestedPath.java

private void setProperty(PathContext pathContext, Object value) throws IllegalAccessException,
        InvocationTargetException, NoSuchMethodException, InstantiationException, IntrospectionException {
    if (pathContext.getPaths().size() > 0) {
        String lastPathElement = getLastElement(pathContext);
        Object lastPathInstance = getLastInstance(pathContext);
        Resolver resolver = pub.getResolver();
        String prop = resolver.getProperty(lastPathElement);
        if (resolver.isMapped(lastPathElement)) {
            ///*from  www. j a v a2 s . co m*/
            // mapped property
            String key = resolver.getKey(lastPathElement);
            value = propertyValue.mapped(lastPathInstance, prop, key, value);
        } else if (resolver.isIndexed(lastPathElement)) {
            //
            // indexed property
            int idx = resolver.getIndex(lastPathElement);
            value = propertyValue.indexed(lastPathInstance, prop, idx, value);
        } else {
            //
            // simple property
            value = propertyValue.simple(lastPathInstance, lastPathElement, value);
        }
        pub.setProperty(lastPathInstance, lastPathElement, value);
    }
}