List of usage examples for org.apache.commons.beanutils.expression Resolver getIndex
int getIndex(String expression);
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 w ww. j av a 2 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); } }