public class ReflectionAttributeExtractor extends java.lang.Object implements AttributeExtractor
Modifier and Type | Class and Description |
---|---|
private static class |
ReflectionAttributeExtractor.FieldPart
A field expression part
|
private static class |
ReflectionAttributeExtractor.FieldRef
A reference to a resolved Field instance
|
private static class |
ReflectionAttributeExtractor.MethodPart
A method expression part
|
private static class |
ReflectionAttributeExtractor.MethodRef
A reference to a resolved Method instance
|
private static interface |
ReflectionAttributeExtractor.Part
A part (method or field) of the expression
|
private static class |
ReflectionAttributeExtractor.StartType
The various types of the start of the expression
|
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
ELEMENT |
private java.lang.String |
expression |
private static java.lang.String |
KEY |
private ReflectionAttributeExtractor.Part[] |
parts |
private ReflectionAttributeExtractor.StartType |
start |
private static java.lang.String |
VALUE |
Constructor and Description |
---|
ReflectionAttributeExtractor(java.lang.String expression)
Create a new ReflectionAttributeExtractor
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
attributeFor(Element e,
java.lang.String attributeName)
Evaluate the expression for the given element
|
private static ReflectionAttributeExtractor.Part[] |
parseExpression(java.lang.String[] tokens,
java.lang.String expression) |
private static void |
verifyToken(java.lang.String token,
java.lang.String expression) |
private static final java.lang.String ELEMENT
private static final java.lang.String KEY
private static final java.lang.String VALUE
private final java.lang.String expression
private final ReflectionAttributeExtractor.Part[] parts
private final ReflectionAttributeExtractor.StartType start
public ReflectionAttributeExtractor(java.lang.String expression) throws InvalidConfigurationException
expression
- InvalidConfigurationException
public java.lang.Object attributeFor(Element e, java.lang.String attributeName) throws AttributeExtractorException
attributeFor
in interface AttributeExtractor
e
- the cache element to inspectattributeName
- the name of the requested attributeAttributeExtractorException
- if there is an error in evaluating the expressionprivate static ReflectionAttributeExtractor.Part[] parseExpression(java.lang.String[] tokens, java.lang.String expression)
private static void verifyToken(java.lang.String token, java.lang.String expression)