org.codehaus.plexus.interpolation
Interface Interpolator

All Known Implementing Classes:
RegexBasedInterpolator, StringSearchInterpolator

public interface Interpolator

Interpolator interface. Based on existing RegexBasedInterpolator interface.

Version:
$Id: Interpolator.java 7529 2008-07-20 20:24:21Z olamy $
Author:
cstamas

Method Summary
 void addPostProcessor(InterpolationPostProcessor postProcessor)
          Add a new post-processor to handle final processing after recursively-interpolated value is determined.
 void addValueSource(ValueSource valueSource)
          Add a new ValueSource to the stack used to resolve expressions in this interpolator instance.
 void clearFeedback()
          Clear the feedback messages from previous interpolate(..) calls.
 java.util.List getFeedback()
          Return any feedback messages and errors that were generated - but suppressed - during the interpolation process.
 java.lang.String interpolate(java.lang.String input)
          See interpolate(String, String, RecursionInterceptor).
 java.lang.String interpolate(java.lang.String input, RecursionInterceptor recursionInterceptor)
          See interpolate(String, String, RecursionInterceptor).
 java.lang.String interpolate(java.lang.String input, java.lang.String thisPrefixPattern)
          See interpolate(String, String, RecursionInterceptor).
 java.lang.String interpolate(java.lang.String input, java.lang.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.
 void removePostProcessor(InterpolationPostProcessor postProcessor)
          Remove the given post-processor.
 void removeValuesSource(ValueSource valueSource)
          Remove the specified ValueSource from the stack used to resolve expressions in this interpolator instance.
 

Method Detail

addValueSource

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


removeValuesSource

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


addPostProcessor

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


removePostProcessor

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


interpolate

java.lang.String interpolate(java.lang.String input,
                             java.lang.String thisPrefixPattern)
                             throws InterpolationException
See interpolate(String, String, RecursionInterceptor).
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.
Throws:
InterpolationException

interpolate

java.lang.String interpolate(java.lang.String input,
                             java.lang.String thisPrefixPattern,
                             RecursionInterceptor recursionInterceptor)
                             throws InterpolationException
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.

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.
Throws:
InterpolationException

interpolate

java.lang.String interpolate(java.lang.String input)
                             throws InterpolationException
See interpolate(String, String, RecursionInterceptor).
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
Throws:
InterpolationException

interpolate

java.lang.String interpolate(java.lang.String input,
                             RecursionInterceptor recursionInterceptor)
                             throws InterpolationException
See interpolate(String, String, RecursionInterceptor).
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.
Throws:
InterpolationException

getFeedback

java.util.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.

clearFeedback

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



Copyright © 2001-2010 Codehaus. All Rights Reserved.