Coverage Report - org.apache.maven.plugin.checkstyle.CheckstyleExecutorRequest
 
Classes in this File Line Coverage Branch Coverage Complexity
CheckstyleExecutorRequest
100%
69/69
N/A
1
 
 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: org.apache.maven.plugin.checkstyle.CheckstyleExecutorRequest.html 816673 2012-05-08 14:06:16Z 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  18
     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  18
     {
 103  
         //nothing
 104  18
     }
 105  
 
 106  
     /**
 107  
      * Returns the includes parameter.
 108  
      *
 109  
      * @return The includes parameter.
 110  
      */
 111  
     public String getIncludes()
 112  
     {
 113  18
         return includes;
 114  
     }
 115  
 
 116  
     public CheckstyleExecutorRequest setIncludes( String includes )
 117  
     {
 118  18
         this.includes = includes;
 119  18
         return this;
 120  
     }
 121  
 
 122  
     public String getExcludes()
 123  
     {
 124  18
         return excludes;
 125  
     }
 126  
 
 127  
     public CheckstyleExecutorRequest setExcludes( String excludes )
 128  
     {
 129  18
         this.excludes = excludes;
 130  18
         return this;
 131  
     }
 132  
 
 133  
     public MavenProject getProject()
 134  
     {
 135  35
         return project;
 136  
     }
 137  
 
 138  
     public CheckstyleExecutorRequest setProject( MavenProject project )
 139  
     {
 140  18
         this.project = project;
 141  18
         return this;
 142  
     }
 143  
 
 144  
     public Log getLog()
 145  
     {
 146  31
         return log;
 147  
     }
 148  
 
 149  
     public CheckstyleExecutorRequest setLog( Log log )
 150  
     {
 151  18
         this.log = log;
 152  18
         return this;
 153  
     }
 154  
 
 155  
     public String getSuppressionsLocation()
 156  
     {
 157  18
         return suppressionsLocation;
 158  
     }
 159  
 
 160  
     public CheckstyleExecutorRequest setSuppressionsLocation( String suppressionsLocation )
 161  
     {
 162  18
         this.suppressionsLocation = suppressionsLocation;
 163  18
         return this;
 164  
     }
 165  
 
 166  
     public boolean isIncludeTestSourceDirectory()
 167  
     {
 168  57
         return includeTestSourceDirectory;
 169  
     }
 170  
 
 171  
     public CheckstyleExecutorRequest setIncludeTestSourceDirectory( boolean includeTestSourceDirectory )
 172  
     {
 173  18
         this.includeTestSourceDirectory = includeTestSourceDirectory;
 174  18
         return this;
 175  
     }
 176  
 
 177  
     public File getTestSourceDirectory()
 178  
     {
 179  36
         return testSourceDirectory;
 180  
     }
 181  
 
 182  
     public CheckstyleExecutorRequest setTestSourceDirectory( File testSourceDirectory )
 183  
     {
 184  18
         this.testSourceDirectory = testSourceDirectory;
 185  18
         return this;
 186  
     }
 187  
 
 188  
     public File getSourceDirectory()
 189  
     {
 190  36
         return sourceDirectory;
 191  
     }
 192  
 
 193  
     public CheckstyleExecutorRequest setSourceDirectory( File sourceDirectory )
 194  
     {
 195  18
         this.sourceDirectory = sourceDirectory;
 196  18
         return this;
 197  
     }
 198  
 
 199  
     public boolean isFailsOnError()
 200  
     {
 201  17
         return failsOnError;
 202  
     }
 203  
 
 204  
     public CheckstyleExecutorRequest setFailsOnError( boolean failsOnError )
 205  
     {
 206  18
         this.failsOnError = failsOnError;
 207  18
         return this;
 208  
     }
 209  
 
 210  
     public AuditListener getListener()
 211  
     {
 212  17
         return listener;
 213  
     }
 214  
 
 215  
     public CheckstyleExecutorRequest setListener( AuditListener listener )
 216  
     {
 217  18
         this.listener = listener;
 218  18
         return this;
 219  
     }
 220  
 
 221  
     public boolean isConsoleOutput()
 222  
     {
 223  17
         return consoleOutput;
 224  
     }
 225  
 
 226  
     public CheckstyleExecutorRequest setConsoleOutput( boolean consoleOutput )
 227  
     {
 228  18
         this.consoleOutput = consoleOutput;
 229  18
         return this;
 230  
     }
 231  
 
 232  
     public CheckstyleExecutorRequest setConsoleListener( DefaultLogger defaultLogger )
 233  
     {
 234  18
         this.defaultLogger = defaultLogger;
 235  18
         return this;
 236  
     }
 237  
 
 238  
     public DefaultLogger getConsoleListener()
 239  
     {
 240  4
         return this.defaultLogger;
 241  
     }
 242  
 
 243  
     public ByteArrayOutputStream getStringOutputStream()
 244  
     {
 245  32
         return stringOutputStream;
 246  
     }
 247  
 
 248  
     public CheckstyleExecutorRequest setStringOutputStream( ByteArrayOutputStream stringOutputStream )
 249  
     {
 250  18
         this.stringOutputStream = stringOutputStream;
 251  18
         return this;
 252  
     }
 253  
 
 254  
     public String getConfigLocation()
 255  
     {
 256  34
         return configLocation;
 257  
     }
 258  
 
 259  
     public CheckstyleExecutorRequest setConfigLocation( String configLocation )
 260  
     {
 261  18
         this.configLocation = configLocation;
 262  18
         return this;
 263  
     }
 264  
 
 265  
     public String getPropertyExpansion()
 266  
     {
 267  17
         return propertyExpansion;
 268  
     }
 269  
 
 270  
     public CheckstyleExecutorRequest setPropertyExpansion( String propertyExpansion )
 271  
     {
 272  18
         this.propertyExpansion = propertyExpansion;
 273  18
         return this;
 274  
     }
 275  
 
 276  
     public String getHeaderLocation()
 277  
     {
 278  19
         return headerLocation;
 279  
     }
 280  
 
 281  
     public CheckstyleExecutorRequest setHeaderLocation( String headerLocation )
 282  
     {
 283  18
         this.headerLocation = headerLocation;
 284  18
         return this;
 285  
     }
 286  
 
 287  
     public String getCacheFile()
 288  
     {
 289  34
         return cacheFile;
 290  
     }
 291  
 
 292  
     public CheckstyleExecutorRequest setCacheFile( String cacheFile )
 293  
     {
 294  18
         this.cacheFile = cacheFile;
 295  18
         return this;
 296  
     }
 297  
 
 298  
     public String getSuppressionsFileExpression()
 299  
     {
 300  17
         return suppressionsFileExpression;
 301  
     }
 302  
 
 303  
     public CheckstyleExecutorRequest setSuppressionsFileExpression( String suppressionsFileExpression )
 304  
     {
 305  18
         this.suppressionsFileExpression = suppressionsFileExpression;
 306  18
         return this;
 307  
     }
 308  
 
 309  
     public String getEncoding()
 310  
     {
 311  51
         return encoding;
 312  
     }
 313  
 
 314  
     public CheckstyleExecutorRequest setEncoding( String encoding )
 315  
     {
 316  18
         this.encoding = encoding;
 317  18
         return this;
 318  
     }
 319  
 
 320  
     public String getPropertiesLocation()
 321  
     {
 322  17
         return propertiesLocation;
 323  
     }
 324  
 
 325  
     public void setPropertiesLocation( String propertiesLocation )
 326  
     {
 327  18
         this.propertiesLocation = propertiesLocation;
 328  18
     }
 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  52
         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  2
         this.aggregate = pAggregate;
 349  2
         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  6
         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  2
         this.reactorProjects = pReactorProjects;
 371  2
         return this;
 372  
     }
 373  
 }