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.
Modifier and Type | Method | Description |
---|---|---|
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.
|
public static java.lang.Object evaluate(@Nonnull java.lang.String expression, @Nullable java.lang.Object root) throws org.apache.maven.shared.utils.introspection.IntrospectionException
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 objectorg.apache.maven.shared.utils.introspection.IntrospectionException
- if anypublic static java.lang.Object evaluate(@Nonnull java.lang.String expression, @Nullable java.lang.Object root, boolean trimRootToken) throws org.apache.maven.shared.utils.introspection.IntrospectionException
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 root token yes/no.org.apache.maven.shared.utils.introspection.IntrospectionException
- if anyCopyright © 2018. All rights reserved.