org.codehaus.plexus.util.introspection
public class ReflectionValueExtractor extends Object
Using simple dotted expressions to extract the values from an Object instance,
For example we might want to extract a value like: project.build.sourceDirectory
The implementation supports indexed, nested and mapped properties similar to the JSP way.
Version: $Id: ReflectionValueExtractor.java 8010 2009-01-07 12:59:50Z vsiveton $
See Also: http://struts.apache.org/1.x/struts-taglib/indexedprops.html
Method Summary | |
---|---|
static Object | evaluate(String expression, Object root) The implementation supports indexed, nested and mapped properties.
|
static Object | evaluate(String expression, Object root, boolean trimRootToken) The implementation supports indexed, nested and mapped properties.
|
The implementation supports indexed, nested and mapped properties.
(\\w+)\\[(\\d+)\\]
pattern, i.e. "user.addresses[1].street"(\\w+)\\((.+)\\)
pattern, i.e. "user.addresses(myAddress).street"Parameters: expression not null expression root not null object
Returns: the object defined by the expression
Throws: Exception if any
The implementation supports indexed, nested and mapped properties.
(\\w+)\\[(\\d+)\\]
pattern, i.e. "user.addresses[1].street"(\\w+)\\((.+)\\)
pattern, i.e. "user.addresses(myAddress).street"Parameters: expression not null expression root not null object
Returns: the object defined by the expression
Throws: Exception if any