Class FixedStringSearchInterpolator
- java.lang.Object
-
- org.codehaus.plexus.interpolation.fixed.FixedStringSearchInterpolator
-
- All Implemented Interfaces:
FixedValueSource
public class FixedStringSearchInterpolator extends java.lang.Object implements FixedValueSource
A fixed string search interpolator is permanently bound to a given set of value sources, an is totally fixed and stateless over these value sources.
The fixed interpolator is also a #StatelessValueSource and can be used as a source for a different fixed interpolator, creating a scope chain.
Once constructed, this interpolator will always point to the same set of objects (value sources), in such a way that if the underlying object is fixed, expressions will always evaluate to the same result.
The fixed interpolator can be shared among different clients and is thread safe to the extent the underlying value sources can be accessed safely. Since interpolation expressions cannot modify the objects, thread safety concerns this will normally be limited to safe publication and memory model visibility of underlying objects.
The fixed interpolator can be a valuesource
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_END_EXPR
static java.lang.String
DEFAULT_START_EXPR
private java.lang.String
endExpr
private java.lang.String
escapeString
private InterpolationPostProcessor
postProcessor
private java.lang.String
startExpr
private FixedValueSource[]
valueSources
-
Constructor Summary
Constructors Modifier Constructor Description private
FixedStringSearchInterpolator(java.lang.String startExpr, java.lang.String endExpr, java.lang.String escapeString, InterpolationPostProcessor postProcessor, FixedValueSource... valueSources)
-
Method Summary
-
-
-
Field Detail
-
valueSources
private final FixedValueSource[] valueSources
-
postProcessor
private final InterpolationPostProcessor postProcessor
-
DEFAULT_START_EXPR
public static final java.lang.String DEFAULT_START_EXPR
- See Also:
- Constant Field Values
-
DEFAULT_END_EXPR
public static final java.lang.String DEFAULT_END_EXPR
- See Also:
- Constant Field Values
-
startExpr
private final java.lang.String startExpr
-
endExpr
private final java.lang.String endExpr
-
escapeString
private final java.lang.String escapeString
-
-
Constructor Detail
-
FixedStringSearchInterpolator
private FixedStringSearchInterpolator(java.lang.String startExpr, java.lang.String endExpr, java.lang.String escapeString, InterpolationPostProcessor postProcessor, FixedValueSource... valueSources)
-
-
Method Detail
-
create
public static FixedStringSearchInterpolator create(java.lang.String startExpr, java.lang.String endExpr, FixedValueSource... valueSources)
-
create
public static FixedStringSearchInterpolator create(FixedValueSource... valueSources)
-
createWithPermittedNulls
public static FixedStringSearchInterpolator createWithPermittedNulls(FixedValueSource... valueSources)
-
withExpressionMarkers
public FixedStringSearchInterpolator withExpressionMarkers(java.lang.String startExpr, java.lang.String endExpr)
-
withPostProcessor
public FixedStringSearchInterpolator withPostProcessor(InterpolationPostProcessor postProcessor)
-
withEscapeString
public FixedStringSearchInterpolator withEscapeString(java.lang.String escapeString)
-
interpolate
public java.lang.String interpolate(java.lang.String input) throws InterpolationCycleException
- Throws:
InterpolationCycleException
-
empty
public static FixedStringSearchInterpolator empty()
-
getValue
public java.lang.Object getValue(java.lang.String realExpr, InterpolationState interpolationState)
- Specified by:
getValue
in interfaceFixedValueSource
- Parameters:
realExpr
- The expression.interpolationState
-InterpolationState
.- Returns:
- the value related to the expression, or null if not found (not available from this source)
-
asBasicInterpolator
public BasicInterpolator asBasicInterpolator()
-
interpolate
public java.lang.String interpolate(java.lang.String input, InterpolationState interpolationState) throws InterpolationCycleException
- Throws:
InterpolationCycleException
-
-