View Javadoc
1   package org.apache.maven.shared.filtering;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *    http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import java.io.Reader;
23  import java.util.List;
24  
25  import org.apache.maven.execution.MavenSession;
26  import org.apache.maven.project.MavenProject;
27  import org.apache.maven.shared.utils.io.FileUtils;
28  
29  import javax.annotation.Nonnull;
30  import javax.annotation.Nullable;
31  
32  /**
33   * @author Olivier Lamy
34   * @author Kristian Rosenvold
35   * @since 1.3
36   */
37  public interface MavenReaderFilter
38      extends DefaultFilterInfo
39  {
40      /**
41       * Provides a new reader that applies filtering using defaultFilterWrappers.
42       *
43       * @param from  the source reader
44       * @param filtering    enable or not filering
45       * @param mavenProject the mavenproject
46       * @param filters      {@link java.util.List} of String which are path to a Property file
47       * @return an input stream that applies the filter
48       * @throws org.apache.maven.shared.filtering.MavenFilteringException
49       * @see #getDefaultFilterWrappers(org.apache.maven.project.MavenProject, java.util.List, boolean, org.apache.maven.execution.MavenSession)
50       */
51      @Nonnull Reader filter( @Nonnull Reader from, boolean filtering, @Nullable MavenProject mavenProject, List<String> filters,
52                     boolean escapedBackslashesInFilePath, MavenSession mavenSession )
53          throws MavenFilteringException;
54  
55      /**
56       * Provides a new reader that applies filtering using defaultFilterWrappers.
57       *
58       * @param mavenFileFilterRequest The filter request
59       * @throws org.apache.maven.shared.filtering.MavenFilteringException
60       * @return an input stream that applies the filter
61       * @since 1.0-beta-3
62       */
63      @Nonnull Reader filter( @Nonnull MavenReaderFilterRequest mavenFileFilterRequest )
64          throws MavenFilteringException;
65  
66      /**
67       * Provides a new reader that applies filtering using defaultFilterWrappers.
68       *
69       * @param from  the source reader
70       * @param filtering true to apply filtering
71       * @param filterWrappers {@link java.util.List} of FileUtils.FilterWrapper
72       * @return an input stream that applies the filter
73       */
74      @Nonnull Reader filter( @Nonnull Reader from, boolean filtering, @Nonnull List<FileUtils.FilterWrapper> filterWrappers );
75  }