|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
com.puppycrawl.tools.checkstyle.CheckStyleTask
public class CheckStyleTask
An implementation of a ANT task for calling checkstyle. See the documentation of the task for usage.
Nested Class Summary | |
---|---|
static class |
CheckStyleTask.Formatter
Details about a formatter to be used. |
static class |
CheckStyleTask.FormatterType
Poor mans enumeration for the formatter types. |
static class |
CheckStyleTask.Listener
Represents a custom listener. |
static class |
CheckStyleTask.Property
Represents a property that consists of a key and value. |
Field Summary |
---|
Fields inherited from class org.apache.tools.ant.Task |
---|
description, location, target, taskName, taskType, wrapper |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
---|
project |
Constructor Summary | |
---|---|
CheckStyleTask()
|
Method Summary | |
---|---|
void |
addFileset(org.apache.tools.ant.types.FileSet aFS)
Adds a set of files (nested fileset attribute). |
void |
addFormatter(CheckStyleTask.Formatter aFormatter)
Add a formatter. |
void |
addProperty(CheckStyleTask.Property aProperty)
Add an override property. |
org.apache.tools.ant.types.Path |
createClasspath()
|
void |
execute()
Actually checks the files specified. |
protected AuditListener[] |
getListeners()
Return the list of listeners set in this task. |
protected File[] |
scanFileSets()
returns the list of files (full path name) to process. |
void |
setClasspath(org.apache.tools.ant.types.Path aClasspath)
Set the class path. |
void |
setClasspathRef(org.apache.tools.ant.types.Reference aClasspathRef)
Set the class path from a reference defined elsewhere. |
void |
setConfig(File aFile)
|
void |
setConfigURL(URL aURL)
|
void |
setFailOnViolation(boolean aFail)
|
void |
setFailureProperty(String aPropertyName)
Tells this task to set the named property to "true" when there is a violation. |
void |
setFile(File aFile)
|
void |
setMaxErrors(int aMaxErrors)
Sets the maximum number of errors allowed. |
void |
setMaxWarnings(int aMaxWarnings)
Sets the maximum number of warings allowed. |
void |
setPackageNamesFile(File aFile)
|
void |
setProperties(File aProps)
Sets a properties file for use instead of individually setting them. |
Methods inherited from class org.apache.tools.ant.Task |
---|
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
---|
getProject, setProject |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CheckStyleTask()
Method Detail |
---|
public void setFailureProperty(String aPropertyName)
aPropertyName
- the name of the property to set
in the event of an failure.public void setFailOnViolation(boolean aFail)
aFail
- whether to fail if a violation is foundpublic void setMaxErrors(int aMaxErrors)
aMaxErrors
- the maximum number of errors allowed.public void setMaxWarnings(int aMaxWarnings)
Integer.MAX_VALUE
.
aMaxWarnings
- the maximum number of warnings allowed.public void addFileset(org.apache.tools.ant.types.FileSet aFS)
aFS
- the file set to addpublic void addFormatter(CheckStyleTask.Formatter aFormatter)
aFormatter
- the formatter to add for logging.public void addProperty(CheckStyleTask.Property aProperty)
aProperty
- the property to addpublic void setClasspath(org.apache.tools.ant.types.Path aClasspath)
aClasspath
- the path to locate classespublic void setClasspathRef(org.apache.tools.ant.types.Reference aClasspathRef)
aClasspathRef
- the reference to an instance defining the classpathpublic org.apache.tools.ant.types.Path createClasspath()
public void setFile(File aFile)
aFile
- the file to be checkedpublic void setConfig(File aFile)
aFile
- the configuration file to usepublic void setConfigURL(URL aURL)
aURL
- the URL of the configuration to usepublic void setPackageNamesFile(File aFile)
aFile
- the package names file to usepublic void setProperties(File aProps)
aProps
- the properties File to usepublic void execute() throws org.apache.tools.ant.BuildException
execute
in class org.apache.tools.ant.Task
org.apache.tools.ant.BuildException
- an error occurredprotected AuditListener[] getListeners() throws ClassNotFoundException, InstantiationException, IllegalAccessException, IOException
ClassNotFoundException
- if an error occurs
InstantiationException
- if an error occurs
IllegalAccessException
- if an error occurs
IOException
- if an error occursprotected File[] scanFileSets()
|
Back to the Checkstyle Home Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |