public class ReflectionValueExtractor extends Object
Using simple dotted expressions extract the values from a MavenProject instance, For example we might want to extract a value like: project.build.sourceDirectory
| Modifier and Type | Method and Description |
|---|---|
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.
|
public static Object evaluate(String expression, Object root) throws Exception
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"expression - not null expressionroot - not null objectException - if anypublic static Object evaluate(String expression, Object root, boolean trimRootToken) throws Exception
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"expression - not null expressionroot - not null objecttrimRootToken - trim the token or not.Exception - if anyCopyright © 2001–2019 Codehaus Plexus. All rights reserved.