View Javadoc

1   package org.apache.maven.plugin.checkstyle;
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.ByteArrayOutputStream;
23  import java.io.File;
24  import java.util.List;
25  
26  import org.apache.maven.plugin.logging.Log;
27  import org.apache.maven.project.MavenProject;
28  
29  import com.puppycrawl.tools.checkstyle.DefaultLogger;
30  import com.puppycrawl.tools.checkstyle.api.AuditListener;
31  
32  /**
33   * @author <a href="mailto:olamy@apache.org">olamy</a>
34   * @since 2.5
35   * @version $Id: CheckstyleExecutorRequest.html 816667 2012-05-08 14:02:08Z hboutemy $
36   */
37  public class CheckstyleExecutorRequest
38  {
39  
40      /**
41       * Specifies the names filter of the source files to be used for Checkstyle.
42       */
43      private String includes;
44  
45      /**
46       * Specifies the names filter of the source files to be excluded for Checkstyle.
47       */
48      private String excludes;
49  
50      private MavenProject project;
51  
52      private Log log;
53  
54      private String suppressionsLocation;
55  
56      private boolean includeTestSourceDirectory;
57  
58      private File testSourceDirectory;
59  
60      private File sourceDirectory;
61  
62      private boolean failsOnError;
63  
64      private AuditListener listener;
65  
66      private boolean consoleOutput;
67  
68      private DefaultLogger defaultLogger;
69  
70      private ByteArrayOutputStream stringOutputStream;
71  
72      private String propertiesLocation;
73  
74      //
75  
76      private String configLocation;
77  
78      private String propertyExpansion;
79  
80      private String headerLocation;
81  
82      private String cacheFile;
83  
84      private String suppressionsFileExpression;
85  
86      private String encoding;
87  
88      /**
89       * @since 2.8
90       */
91      private boolean aggregate = false;
92  
93      /**
94       * @since 2.8
95       */
96      private List<MavenProject> reactorProjects;
97  
98      /**
99       * Constructor.
100      */
101     public CheckstyleExecutorRequest( )
102     {
103         //nothing
104     }
105 
106     /**
107      * Returns the includes parameter.
108      *
109      * @return The includes parameter.
110      */
111     public String getIncludes()
112     {
113         return includes;
114     }
115 
116     public CheckstyleExecutorRequest setIncludes( String includes )
117     {
118         this.includes = includes;
119         return this;
120     }
121 
122     public String getExcludes()
123     {
124         return excludes;
125     }
126 
127     public CheckstyleExecutorRequest setExcludes( String excludes )
128     {
129         this.excludes = excludes;
130         return this;
131     }
132 
133     public MavenProject getProject()
134     {
135         return project;
136     }
137 
138     public CheckstyleExecutorRequest setProject( MavenProject project )
139     {
140         this.project = project;
141         return this;
142     }
143 
144     public Log getLog()
145     {
146         return log;
147     }
148 
149     public CheckstyleExecutorRequest setLog( Log log )
150     {
151         this.log = log;
152         return this;
153     }
154 
155     public String getSuppressionsLocation()
156     {
157         return suppressionsLocation;
158     }
159 
160     public CheckstyleExecutorRequest setSuppressionsLocation( String suppressionsLocation )
161     {
162         this.suppressionsLocation = suppressionsLocation;
163         return this;
164     }
165 
166     public boolean isIncludeTestSourceDirectory()
167     {
168         return includeTestSourceDirectory;
169     }
170 
171     public CheckstyleExecutorRequest setIncludeTestSourceDirectory( boolean includeTestSourceDirectory )
172     {
173         this.includeTestSourceDirectory = includeTestSourceDirectory;
174         return this;
175     }
176 
177     public File getTestSourceDirectory()
178     {
179         return testSourceDirectory;
180     }
181 
182     public CheckstyleExecutorRequest setTestSourceDirectory( File testSourceDirectory )
183     {
184         this.testSourceDirectory = testSourceDirectory;
185         return this;
186     }
187 
188     public File getSourceDirectory()
189     {
190         return sourceDirectory;
191     }
192 
193     public CheckstyleExecutorRequest setSourceDirectory( File sourceDirectory )
194     {
195         this.sourceDirectory = sourceDirectory;
196         return this;
197     }
198 
199     public boolean isFailsOnError()
200     {
201         return failsOnError;
202     }
203 
204     public CheckstyleExecutorRequest setFailsOnError( boolean failsOnError )
205     {
206         this.failsOnError = failsOnError;
207         return this;
208     }
209 
210     public AuditListener getListener()
211     {
212         return listener;
213     }
214 
215     public CheckstyleExecutorRequest setListener( AuditListener listener )
216     {
217         this.listener = listener;
218         return this;
219     }
220 
221     public boolean isConsoleOutput()
222     {
223         return consoleOutput;
224     }
225 
226     public CheckstyleExecutorRequest setConsoleOutput( boolean consoleOutput )
227     {
228         this.consoleOutput = consoleOutput;
229         return this;
230     }
231 
232     public CheckstyleExecutorRequest setConsoleListener( DefaultLogger defaultLogger )
233     {
234         this.defaultLogger = defaultLogger;
235         return this;
236     }
237 
238     public DefaultLogger getConsoleListener()
239     {
240         return this.defaultLogger;
241     }
242 
243     public ByteArrayOutputStream getStringOutputStream()
244     {
245         return stringOutputStream;
246     }
247 
248     public CheckstyleExecutorRequest setStringOutputStream( ByteArrayOutputStream stringOutputStream )
249     {
250         this.stringOutputStream = stringOutputStream;
251         return this;
252     }
253 
254     public String getConfigLocation()
255     {
256         return configLocation;
257     }
258 
259     public CheckstyleExecutorRequest setConfigLocation( String configLocation )
260     {
261         this.configLocation = configLocation;
262         return this;
263     }
264 
265     public String getPropertyExpansion()
266     {
267         return propertyExpansion;
268     }
269 
270     public CheckstyleExecutorRequest setPropertyExpansion( String propertyExpansion )
271     {
272         this.propertyExpansion = propertyExpansion;
273         return this;
274     }
275 
276     public String getHeaderLocation()
277     {
278         return headerLocation;
279     }
280 
281     public CheckstyleExecutorRequest setHeaderLocation( String headerLocation )
282     {
283         this.headerLocation = headerLocation;
284         return this;
285     }
286 
287     public String getCacheFile()
288     {
289         return cacheFile;
290     }
291 
292     public CheckstyleExecutorRequest setCacheFile( String cacheFile )
293     {
294         this.cacheFile = cacheFile;
295         return this;
296     }
297 
298     public String getSuppressionsFileExpression()
299     {
300         return suppressionsFileExpression;
301     }
302 
303     public CheckstyleExecutorRequest setSuppressionsFileExpression( String suppressionsFileExpression )
304     {
305         this.suppressionsFileExpression = suppressionsFileExpression;
306         return this;
307     }
308 
309     public String getEncoding()
310     {
311         return encoding;
312     }
313 
314     public CheckstyleExecutorRequest setEncoding( String encoding )
315     {
316         this.encoding = encoding;
317         return this;
318     }
319 
320     public String getPropertiesLocation()
321     {
322         return propertiesLocation;
323     }
324 
325     public void setPropertiesLocation( String propertiesLocation )
326     {
327         this.propertiesLocation = propertiesLocation;
328     }
329 
330     /**
331      * Returns true if the report is aggregated.
332      *
333      * @return <code>true</code> if the report is aggregated.
334      */
335     public boolean isAggregate()
336     {
337         return aggregate;
338     }
339 
340     /**
341      * Sets the aggregate parameter.
342      *
343      * @param pAggregate <code>true</code> if an aggregated report is desidered.
344      * @return This object.
345      */
346     public CheckstyleExecutorRequest setAggregate( boolean pAggregate )
347     {
348         this.aggregate = pAggregate;
349         return this;
350     }
351 
352     /**
353      * Returns the list of reactor projects.
354      *
355      * @return The reactor projects.
356      */
357     public List<MavenProject> getReactorProjects()
358     {
359         return reactorProjects;
360     }
361 
362     /**
363      * Sets the list of reactor projects.
364      *
365      * @param pReactorProjects The reactor projects.
366      * @return This object.
367      */
368     public CheckstyleExecutorRequest setReactorProjects( List<MavenProject> pReactorProjects )
369     {
370         this.reactorProjects = pReactorProjects;
371         return this;
372     }
373 }