public class AccessorMap.ExpressionTargetProxy extends EvaluatePropExpressionVisitor implements ExpressionTargetContainer
ExpressionTargetContainer via the Accessors.
Note that the getExpressionTargetFactory method is forwarded to the underlying object.
Application classes will usually implement ExpressionTarget by holding a reference to
one of these.
This class can also implements a cache of result values that is populated
by calling the evaluate method and cleared with the flush method.
This allows a record to hold a copy of its own visitor and use it as a value cache.| Constructor and Description |
|---|
AccessorMap.ExpressionTargetProxy(X r) |
AccessorMap.ExpressionTargetProxy(X r,
boolean use_cache) |
| Modifier and Type | Method and Description |
|---|---|
<R> R |
evaluateExpression(PropExpression<R> expr)
Evaluate an expression on the target object
|
<R> R |
evaluateExpression(PropExpression<R> expr,
R def)
Evaluate expression with default.
|
void |
flush() |
java.util.Set<PropertyTag> |
getDefinedProperties()
Generate a set of all the properties defined in this container
|
Parser |
getParser()
Get a
Parser used to parse expressions for
this target. |
<T> T |
getProperty(PropertyTag<T> key)
Get the specified property from the container.
|
<T> T |
getProperty(PropertyTag<T> tag,
T def)
Get property with default.
|
protected boolean |
matches(RecordSelector sel)
Check if a
RecordSelector matches the target object |
void |
reset() |
void |
setAll(PropertyContainer source)
Copy all compatible properties from one container to another;
|
<T> void |
setOptionalProperty(PropertyTag<? super T> t,
T value)
Set the specified property if it is supported
|
<T> void |
setProperty(PropertyTag<? super T> t,
T value)
Set the specified property
|
boolean |
supports(PropertyTag<?> tag)
Is the specified property supported by the container.
|
java.lang.Object |
visitPropertyTag(PropertyTag<?> tag) |
boolean |
writable(PropertyTag<?> tag)
Is the specified property supported for write.
|
getContext, visitBinaryPropExpression, visitCasePropExpression, visitConstPropExpression, visitConvetMillisecondToDateExpression, visitDeRefExpression, visitDoublePropExpression, visitDurationCastPropExpression, visitDurationPropExpression, visitDurationSecondPropExpression, visitIntPropExpression, visitLabelPropExpression, visitMilliSecondDatePropExpression, visitNamePropExpression, visitSelectPropExpression, visitStringPropExpression, visitTypeConverterPropExpressionpublic AccessorMap.ExpressionTargetProxy(X r, boolean use_cache)
public AccessorMap.ExpressionTargetProxy(X r)
public <R> R evaluateExpression(PropExpression<R> expr) throws InvalidPropertyException
ExpressionTargetevaluateExpression in interface ExpressionTargetInvalidPropertyExceptionR - type of expressionexpr - expressionpublic <R> R evaluateExpression(PropExpression<R> expr, R def)
ExpressionTargetevaluateExpression in interface ExpressionTargetR - type of expressionexpr - expressiondef - default valuepublic void flush()
public <T> void setProperty(PropertyTag<? super T> t, T value) throws InvalidPropertyException
PropertyContainersetProperty in interface PropertyContainerInvalidPropertyExceptionT - type of propertyt - PropertyTag identifying propertypublic <T> void setOptionalProperty(PropertyTag<? super T> t, T value)
PropertyContainersetOptionalProperty in interface PropertyContainerT - type of propertyt - PropertyTag identifying propertypublic java.lang.Object visitPropertyTag(PropertyTag<?> tag) throws java.lang.Exception
visitPropertyTag in interface BasePropExpressionVisitor<java.lang.Object>java.lang.Exceptionpublic void reset()
public <T> T getProperty(PropertyTag<T> tag, T def)
PropertyTargetgetProperty in interface PropertyTargetT - Type of propertytag - PropertTag identifying propertydef - default valuepublic boolean supports(PropertyTag<?> tag)
PropertyContainersupports in interface PropertyContainerpublic <T> T getProperty(PropertyTag<T> key) throws InvalidPropertyException
PropertyContainergetProperty in interface PropertyContainerInvalidPropertyExceptionT - type of propertykey - PropertyTag identifying propertypublic boolean writable(PropertyTag<?> tag)
PropertyContainerwritable in interface PropertyContainerpublic java.util.Set<PropertyTag> getDefinedProperties()
PropertyContainergetDefinedProperties in interface PropertyContainerpublic void setAll(PropertyContainer source)
PropertyContainersetAll in interface PropertyContainersource - PropertyContainerpublic Parser getParser()
ExpressionTargetParser used to parse expressions for
this target.getParser in interface ExpressionTargetprotected boolean matches(RecordSelector sel) throws java.lang.Exception
EvaluatePropExpressionVisitorRecordSelector matches the target objectmatches in class EvaluatePropExpressionVisitorjava.lang.Exception