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  
25  import org.apache.maven.plugin.logging.Log;
26  import org.apache.maven.project.MavenProject;
27  
28  import com.puppycrawl.tools.checkstyle.DefaultLogger;
29  import com.puppycrawl.tools.checkstyle.api.AuditListener;
30  
31  /**
32   * @author <a href="mailto:olamy@apache.org">olamy</a>
33   * @since 2.5
34   * @version $Id: CheckstyleExecutorRequest.html 816658 2012-05-08 13:56:19Z hboutemy $
35   */
36  public class CheckstyleExecutorRequest
37  {
38     
39      /**
40       * Specifies the names filter of the source files to be used for Checkstyle.
41       */
42      private String includes;
43  
44      /**
45       * Specifies the names filter of the source files to be excluded for Checkstyle.
46       */
47      private String excludes;
48      
49      private MavenProject project;
50      
51      private Log log;
52      
53      private String suppressionsLocation;
54      
55      private boolean includeTestSourceDirectory;
56      
57      private File testSourceDirectory;
58      
59      private File sourceDirectory;
60      
61      private boolean failsOnError;
62      
63      private AuditListener listener;
64      
65      private boolean consoleOutput;
66      
67      private DefaultLogger defaultLogger;
68      
69      private ByteArrayOutputStream stringOutputStream;
70      
71      private String propertiesLocation;
72      
73      //
74      
75      private String configLocation;
76  
77      private String propertyExpansion;
78      
79      private String headerLocation; 
80      
81      private String cacheFile;  
82      
83      private String suppressionsFileExpression;
84      
85      private String encoding; 
86  
87      public CheckstyleExecutorRequest( )
88      {
89          //nothing 
90      }    
91      
92      public String getIncludes()
93      {
94          return includes;
95      }
96  
97      public CheckstyleExecutorRequest setIncludes( String includes )
98      {
99          this.includes = includes;
100         return this;
101     }
102 
103     public String getExcludes()
104     {
105         return excludes;
106     }
107 
108     public CheckstyleExecutorRequest setExcludes( String excludes )
109     {
110         this.excludes = excludes;
111         return this;
112     }
113 
114     public MavenProject getProject()
115     {
116         return project;
117     }
118 
119     public CheckstyleExecutorRequest setProject( MavenProject project )
120     {
121         this.project = project;
122         return this;
123     }
124 
125     public Log getLog()
126     {
127         return log;
128     }
129 
130     public CheckstyleExecutorRequest setLog( Log log )
131     {
132         this.log = log;
133         return this;
134     }
135 
136     public String getSuppressionsLocation()
137     {
138         return suppressionsLocation;
139     }
140 
141     public CheckstyleExecutorRequest setSuppressionsLocation( String suppressionsLocation )
142     {
143         this.suppressionsLocation = suppressionsLocation;
144         return this;
145     }
146 
147     public boolean isIncludeTestSourceDirectory()
148     {
149         return includeTestSourceDirectory;
150     }
151 
152     public CheckstyleExecutorRequest setIncludeTestSourceDirectory( boolean includeTestSourceDirectory )
153     {
154         this.includeTestSourceDirectory = includeTestSourceDirectory;
155         return this;
156     }
157 
158     public File getTestSourceDirectory()
159     {
160         return testSourceDirectory;
161     }
162 
163     public CheckstyleExecutorRequest setTestSourceDirectory( File testSourceDirectory )
164     {
165         this.testSourceDirectory = testSourceDirectory;
166         return this;
167     }
168 
169     public File getSourceDirectory()
170     {
171         return sourceDirectory;
172     }
173 
174     public CheckstyleExecutorRequest setSourceDirectory( File sourceDirectory )
175     {
176         this.sourceDirectory = sourceDirectory;
177         return this;
178     }
179 
180     public boolean isFailsOnError()
181     {
182         return failsOnError;
183     }
184 
185     public CheckstyleExecutorRequest setFailsOnError( boolean failsOnError )
186     {
187         this.failsOnError = failsOnError;
188         return this;
189     }
190 
191     public AuditListener getListener()
192     {
193         return listener;
194     }
195 
196     public CheckstyleExecutorRequest setListener( AuditListener listener )
197     {
198         this.listener = listener;
199         return this;
200     }
201 
202     public boolean isConsoleOutput()
203     {
204         return consoleOutput;
205     }
206 
207     public CheckstyleExecutorRequest setConsoleOutput( boolean consoleOutput )
208     {
209         this.consoleOutput = consoleOutput;
210         return this;
211     }
212     
213     public CheckstyleExecutorRequest setConsoleListener(DefaultLogger defaultLogger)
214     {
215         this.defaultLogger = defaultLogger;
216         return this;
217     }
218 
219     public DefaultLogger getConsoleListener()
220     {
221         return this.defaultLogger;
222     }
223 
224     public ByteArrayOutputStream getStringOutputStream()
225     {
226         return stringOutputStream;
227     }
228 
229     public CheckstyleExecutorRequest setStringOutputStream( ByteArrayOutputStream stringOutputStream )
230     {
231         this.stringOutputStream = stringOutputStream;
232         return this;
233     }
234     
235     public String getConfigLocation()
236     {
237         return configLocation;
238     }
239 
240     public CheckstyleExecutorRequest setConfigLocation( String configLocation )
241     {
242         this.configLocation = configLocation;
243         return this;
244     }
245 
246     public String getPropertyExpansion()
247     {
248         return propertyExpansion;
249     }
250 
251     public CheckstyleExecutorRequest setPropertyExpansion( String propertyExpansion )
252     {
253         this.propertyExpansion = propertyExpansion;
254         return this;
255     }
256     
257     public String getHeaderLocation()
258     {
259         return headerLocation;
260     }
261 
262     public CheckstyleExecutorRequest setHeaderLocation( String headerLocation )
263     {
264         this.headerLocation = headerLocation;
265         return this;
266     }
267 
268     public String getCacheFile()
269     {
270         return cacheFile;
271     }
272 
273     public CheckstyleExecutorRequest setCacheFile( String cacheFile )
274     {
275         this.cacheFile = cacheFile;
276         return this;
277     }
278 
279     public String getSuppressionsFileExpression()
280     {
281         return suppressionsFileExpression;
282     }
283 
284     public CheckstyleExecutorRequest setSuppressionsFileExpression( String suppressionsFileExpression )
285     {
286         this.suppressionsFileExpression = suppressionsFileExpression;
287         return this;
288     }
289 
290     public String getEncoding()
291     {
292         return encoding;
293     }
294 
295     public CheckstyleExecutorRequest setEncoding( String encoding )
296     {
297         this.encoding = encoding;
298         return this;
299     }    
300     
301     public String getPropertiesLocation()
302     {
303         return propertiesLocation;
304     }
305 
306     public void setPropertiesLocation( String propertiesLocation )
307     {
308         this.propertiesLocation = propertiesLocation;
309     }    
310 }