public class CheckstyleAntTask extends org.apache.tools.ant.Task
Modifier and Type | Class and Description |
---|---|
static class |
CheckstyleAntTask.Formatter
Details about a formatter to be used.
|
static class |
CheckstyleAntTask.FormatterType
Poor mans enumeration for the formatter types.
|
static class |
CheckstyleAntTask.Listener
Represents a custom listener.
|
static class |
CheckstyleAntTask.Property
Represents a property that consists of a key and value.
|
Constructor and Description |
---|
CheckstyleAntTask() |
Modifier and Type | Method and Description |
---|---|
void |
addFileset(org.apache.tools.ant.types.FileSet fileSet)
Adds set of files (nested fileset attribute).
|
void |
addFormatter(CheckstyleAntTask.Formatter formatter)
Add a formatter.
|
void |
addPath(org.apache.tools.ant.types.Path path)
Adds a path.
|
void |
addProperty(CheckstyleAntTask.Property property)
Add an override property.
|
org.apache.tools.ant.types.Path |
createClasspath()
Creates classpath.
|
void |
execute() |
protected List<File> |
scanFileSets()
Returns the list of files (full path name) to process.
|
void |
setClasspath(org.apache.tools.ant.types.Path classpath)
Set the class path.
|
void |
setClasspathRef(org.apache.tools.ant.types.Reference classpathRef)
Set the class path from a reference defined elsewhere.
|
void |
setConfig(String configuration)
Sets configuration file.
|
void |
setExecuteIgnoredModules(boolean omit)
Sets flag - whether to execute ignored modules.
|
void |
setFailOnViolation(boolean fail)
Sets flag - whether to fail if a violation is found.
|
void |
setFailureProperty(String propertyName)
Tells this task to write failure message to the named property when there
is a violation.
|
void |
setFile(File file)
Sets file to be checked.
|
void |
setMaxErrors(int maxErrors)
Sets the maximum number of errors allowed.
|
void |
setMaxWarnings(int maxWarnings)
Sets the maximum number of warnings allowed.
|
void |
setProperties(File props)
Sets a properties file for use instead
of individually setting them.
|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
public CheckstyleAntTask()
public void setFailureProperty(String propertyName)
propertyName
- the name of the property to set
in the event of an failure.public void setFailOnViolation(boolean fail)
fail
- whether to fail if a violation is foundpublic void setMaxErrors(int maxErrors)
maxErrors
- the maximum number of errors allowed.public void setMaxWarnings(int maxWarnings)
Integer.MAX_VALUE
.maxWarnings
- the maximum number of warnings allowed.public void addPath(org.apache.tools.ant.types.Path path)
path
- the path to add.public void addFileset(org.apache.tools.ant.types.FileSet fileSet)
fileSet
- the file set to addpublic void addFormatter(CheckstyleAntTask.Formatter formatter)
formatter
- the formatter to add for logging.public void addProperty(CheckstyleAntTask.Property property)
property
- the property to addpublic void setClasspath(org.apache.tools.ant.types.Path classpath)
classpath
- the path to locate classespublic void setClasspathRef(org.apache.tools.ant.types.Reference classpathRef)
classpathRef
- the reference to an instance defining the classpathpublic org.apache.tools.ant.types.Path createClasspath()
public void setFile(File file)
file
- the file to be checkedpublic void setConfig(String configuration)
configuration
- the configuration file, URL, or resource to usepublic void setExecuteIgnoredModules(boolean omit)
omit
- whether to execute ignored modulespublic void setProperties(File props)
props
- the properties File to usepublic void execute()
execute
in class org.apache.tools.ant.Task
protected List<File> scanFileSets()
Copyright © 2001–2018. All rights reserved.