public class PrefixedValueSourceWrapper extends java.lang.Object implements FixedValueSource
FixedValueSource
implementation which simply wraps another
value source, and trims any of a set of possible expression prefixes before delegating the
modified expression to be resolved by the real value source.Modifier and Type | Field and Description |
---|---|
private boolean |
allowUnprefixedExpressions |
private java.lang.String |
lastExpression |
private java.lang.String[] |
possiblePrefixes |
private FixedValueSource |
valueSource |
Constructor and Description |
---|
PrefixedValueSourceWrapper(FixedValueSource valueSource,
java.util.List<java.lang.String> possiblePrefixes)
Wrap the given value source, but first trim one of the given prefixes from any
expressions before they are passed along for resolution.
|
PrefixedValueSourceWrapper(FixedValueSource valueSource,
java.util.List<java.lang.String> possiblePrefixes,
boolean allowUnprefixedExpressions)
Wrap the given value source, but first trim one of the given prefixes from any
expressions before they are passed along for resolution.
|
PrefixedValueSourceWrapper(FixedValueSource valueSource,
java.lang.String prefix)
Wrap the given value source, but first trim the given prefix from any
expressions before they are passed along for resolution.
|
PrefixedValueSourceWrapper(FixedValueSource valueSource,
java.lang.String prefix,
boolean allowUnprefixedExpressions)
Wrap the given value source, but first trim the given prefix from any
expressions before they are passed along for resolution.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getValue(java.lang.String expression,
InterpolationState interpolationState) |
private final FixedValueSource valueSource
private final java.lang.String[] possiblePrefixes
private boolean allowUnprefixedExpressions
private java.lang.String lastExpression
public PrefixedValueSourceWrapper(FixedValueSource valueSource, java.lang.String prefix)
valueSource
- The ValueSource
to wrap.prefix
- The expression prefix to trim.public PrefixedValueSourceWrapper(FixedValueSource valueSource, java.lang.String prefix, boolean allowUnprefixedExpressions)
valueSource
- The ValueSource
to wrap.prefix
- The expression prefix to trim.allowUnprefixedExpressions
- Flag telling the wrapper whether to
continue resolving expressions that don't start with the prefix it tracks.public PrefixedValueSourceWrapper(FixedValueSource valueSource, java.util.List<java.lang.String> possiblePrefixes)
valueSource
- The ValueSource
to wrap.possiblePrefixes
- The List of expression prefixes to trim.public PrefixedValueSourceWrapper(FixedValueSource valueSource, java.util.List<java.lang.String> possiblePrefixes, boolean allowUnprefixedExpressions)
valueSource
- The ValueSource
to wrap.possiblePrefixes
- The List of expression prefixes to trim.allowUnprefixedExpressions
- Flag telling the wrapper whether to
continue resolving expressions that don't start with one of the prefixes it tracks.public java.lang.Object getValue(java.lang.String expression, InterpolationState interpolationState)
getValue
in interface FixedValueSource
expression
- The expression.interpolationState
- InterpolationState
.