org.codehaus.plexus.interpolation

Interface Interpolator

public interface Interpolator

Interpolator interface. Based on existing RegexBasedInterpolator interface.

Version: $Id: Interpolator.java 7826 2008-11-14 16:21:07Z olamy $

Author: cstamas

Method Summary
voidaddPostProcessor(InterpolationPostProcessor postProcessor)
Add a new post-processor to handle final processing after recursively-interpolated value is determined.
voidaddValueSource(ValueSource valueSource)
Add a new ValueSource to the stack used to resolve expressions in this interpolator instance.
voidclearAnswers()
voidclearFeedback()
Clear the feedback messages from previous interpolate(..) calls.
ListgetFeedback()
Return any feedback messages and errors that were generated - but suppressed - during the interpolation process.
Stringinterpolate(String input, String thisPrefixPattern)
Stringinterpolate(String input, String thisPrefixPattern, RecursionInterceptor recursionInterceptor)
Attempt to resolve all expressions in the given input string, using the given pattern to first trim an optional prefix from each expression.
Stringinterpolate(String input)
Stringinterpolate(String input, RecursionInterceptor recursionInterceptor)
booleanisCacheAnswers()
voidremovePostProcessor(InterpolationPostProcessor postProcessor)
Remove the given post-processor.
voidremoveValuesSource(ValueSource valueSource)
Remove the specified ValueSource from the stack used to resolve expressions in this interpolator instance.
voidsetCacheAnswers(boolean cacheAnswers)

Method Detail

addPostProcessor

public void addPostProcessor(InterpolationPostProcessor postProcessor)
Add a new post-processor to handle final processing after recursively-interpolated value is determined.

addValueSource

public void addValueSource(ValueSource valueSource)
Add a new ValueSource to the stack used to resolve expressions in this interpolator instance.

clearAnswers

public void clearAnswers()

clearFeedback

public void clearFeedback()
Clear the feedback messages from previous interpolate(..) calls.

getFeedback

public List getFeedback()
Return any feedback messages and errors that were generated - but suppressed - during the interpolation process. Since unresolvable expressions will be left in the source string as-is, this feedback is optional, and will only be useful for debugging interpolation problems.

Returns: a List that may be interspersed with String and Throwable instances.

interpolate

public String interpolate(String input, String thisPrefixPattern)
See Interpolator.
This method triggers the use of a SimpleRecursionInterceptor instance for protection against expression cycles.

Parameters: input The input string to interpolate thisPrefixPattern An optional pattern that should be trimmed from the start of any expressions found in the input.

interpolate

public String interpolate(String input, String thisPrefixPattern, RecursionInterceptor recursionInterceptor)
Attempt to resolve all expressions in the given input string, using the given pattern to first trim an optional prefix from each expression. The supplied recursion interceptor will provide protection from expression cycles, ensuring that the input can be resolved or an exception is thrown. return an empty String if input is null

Parameters: input The input string to interpolate thisPrefixPattern An optional pattern that should be trimmed from the start of any expressions found in the input. recursionInterceptor Used to protect the interpolation process from expression cycles, and throw an exception if one is detected.

interpolate

public String interpolate(String input)
See Interpolator.
This method triggers the use of a SimpleRecursionInterceptor instance for protection against expression cycles. It also leaves empty the expression prefix which would otherwise be trimmed from expressions. The result is that any detected expression will be resolved as-is.

Parameters: input The input string to interpolate

interpolate

public String interpolate(String input, RecursionInterceptor recursionInterceptor)
See Interpolator.
This method leaves empty the expression prefix which would otherwise be trimmed from expressions. The result is that any detected expression will be resolved as-is.

Parameters: input The input string to interpolate recursionInterceptor Used to protect the interpolation process from expression cycles, and throw an exception if one is detected.

isCacheAnswers

public boolean isCacheAnswers()

removePostProcessor

public void removePostProcessor(InterpolationPostProcessor postProcessor)
Remove the given post-processor.

removeValuesSource

public void removeValuesSource(ValueSource valueSource)
Remove the specified ValueSource from the stack used to resolve expressions in this interpolator instance.

setCacheAnswers

public void setCacheAnswers(boolean cacheAnswers)
Copyright © 2001-2009 Codehaus. All Rights Reserved.