View Javadoc
1   package org.codehaus.plexus.interpolation;
2   /*
3    * Copyright 2014 Codehaus Foundation.
4    *
5    * Licensed under the Apache License, Version 2.0 (the "License");
6    * you may not use this file except in compliance with the License.
7    * You may obtain a copy of the License at
8    *
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  
18  /**
19   * Knows how to do basic interpolation services.
20   *
21   * TODO: Really really needs a way to communicate errors.
22   */
23  public interface BasicInterpolator
24  {
25      /**
26       * See {@link org.codehaus.plexus.interpolation.Interpolator#interpolate(String, String, org.codehaus.plexus.interpolation.RecursionInterceptor)}.
27       * <br/>
28       * This method triggers the use of a {@link org.codehaus.plexus.interpolation.SimpleRecursionInterceptor}
29       * instance for protection against expression cycles. It also leaves empty the
30       * expression prefix which would otherwise be trimmed from expressions. The
31       * result is that any detected expression will be resolved as-is.
32       *
33       * @param input The input string to interpolate
34       */
35      String interpolate( String input )
36          throws InterpolationException;
37  
38      /**
39       * See {@link org.codehaus.plexus.interpolation.Interpolator#interpolate(String, String, org.codehaus.plexus.interpolation.RecursionInterceptor)}.
40       * <br/>
41       * This method leaves empty the expression prefix which would otherwise be
42       * trimmed from expressions. The result is that any detected expression will
43       * be resolved as-is.
44       *
45       * @param input The input string to interpolate
46       *
47       * @param recursionInterceptor Used to protect the interpolation process
48       *                             from expression cycles, and throw an
49       *                             exception if one is detected.
50       */
51      String interpolate( String input, RecursionInterceptor recursionInterceptor )
52          throws InterpolationException;
53  }