## org.codehaus.plexus.util.introspection
Class ReflectionValueExtractor

    java.lang.Object
      org.codehaus.plexus.util.introspection.ReflectionValueExtractor

    public class ReflectionValueExtractor

extends java.lang.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 $
Author:
  Jason van Zyl , Vincent Siveton
See Also:
  http://struts.apache.org/1.x/struts-taglib/indexedprops.html

Method Summary
`static java.lang.Object` `evaluate(java.lang.String expression, java.lang.Object root)` The implementation supports indexed, nested and mapped properties.
`static java.lang.Object` `evaluate(java.lang.String expression, java.lang.Object root, boolean trimRootToken)` The implementation supports indexed, nested and mapped properties.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### evaluate

    public static java.lang.Object evaluate(java.lang.String expression,
                                            java.lang.Object root)
                                     throws java.lang.Exception

  The implementation supports indexed, nested and mapped properties.

  - nested properties should be defined by a dot, i.e. "user.address.street"
  - indexed properties (java.util.List or array instance) should be contains `(\\w+)\\[(\\d+)\\]` pattern, i.e. "user.addresses[1].street"
  - mapped properties should be contains `(\\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:
    `java.lang.Exception` - if any

### evaluate

    public static java.lang.Object evaluate(java.lang.String expression,
                                            java.lang.Object root,
                                            boolean trimRootToken)
                                     throws java.lang.Exception

  The implementation supports indexed, nested and mapped properties.

  - nested properties should be defined by a dot, i.e. "user.address.street"
  - indexed properties (java.util.List or array instance) should be contains `(\\w+)\\[(\\d+)\\]` pattern, i.e. "user.addresses[1].street"
  - mapped properties should be contains `(\\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:
    `java.lang.Exception` - if any