Package edu.umd.cs.findbugs.anttask
Class AbstractFindBugsTask
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
edu.umd.cs.findbugs.anttask.AbstractFindBugsTask
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
ComputeBugHistoryTask,ConvertXmlToTextTask,FilterBugsTask,FindBugsTask,MineBugHistoryTask,SetBugDatabaseInfoTask,UnionBugs2
public abstract class AbstractFindBugsTask
extends org.apache.tools.ant.Task
Abstract base class for Ant tasks that run programs (main() methods) in
findbugs.jar or findbugsGUI.jar.
- Author:
- David Hovemeyer
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longprotected Stringstatic final Stringstatic final StringFields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapperFields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAdd an argument to the JVM used to execute FindBugs.protected voidafterExecuteJavaProcess(int rc) protected abstract voidprotected voidCheck that all required attributes have been set.protected abstract voidorg.apache.tools.ant.types.PathPath to use for classpath.protected voidCreate the FindBugs engine (the Java process that will run whatever FindBugs-related program this task is going to execute).org.apache.tools.ant.types.PathPath to use for plugin list.Create a SystemProperty (to handle <systemProperty> elements).voidexecute()protected booleangetDebug()Get the debug flag.protected org.apache.tools.ant.taskdefs.JavaGet the Findbugs engine.voidsetClasspath(org.apache.tools.ant.types.Path src) Set the classpath to use.voidsetClasspathRef(org.apache.tools.ant.types.Reference r) Adds a reference to a classpath defined elsewhere.voidsetDebug(boolean flag) Set the debug flagvoidsetErrorProperty(String name) Tells this task to set the property with the given name to "true" when there were errors.voidsetFailOnError(boolean flag) Set the failOnError flagvoidSet the home directory into which findbugs was installedprotected voidsetInputString(String input) Sets the given string to be piped to standard input of the FindBugs JVM upon launching.voidSet the command used to start the VMvoidsetJvmargs(String args) Set any specific jvm argsvoidsetPluginList(org.apache.tools.ant.types.Path src) the plugin list to use.voidsetPluginListRef(org.apache.tools.ant.types.Reference r) Adds a reference to a plugin list defined elsewhere.voidsetTimeout(long timeout) Set timeout in milliseconds.Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeMethods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
-
Field Details
-
FINDBUGS_JAR
- See Also:
-
DEFAULT_TIMEOUT
public static final long DEFAULT_TIMEOUT- See Also:
-
RESULT_PROPERTY_SUFFIX
- See Also:
-
errorProperty
-
execResultProperty
-
-
Constructor Details
-
AbstractFindBugsTask
Constructor.
-
-
Method Details
-
setHome
Set the home directory into which findbugs was installed -
setDebug
public void setDebug(boolean flag) Set the debug flag -
getDebug
protected boolean getDebug()Get the debug flag. -
setJvmargs
Set any specific jvm args -
setJvm
Set the command used to start the VM -
setTimeout
public void setTimeout(long timeout) Set timeout in milliseconds.- Parameters:
timeout- the timeout
-
setFailOnError
public void setFailOnError(boolean flag) Set the failOnError flag -
setErrorProperty
Tells this task to set the property with the given name to "true" when there were errors. -
createSystemProperty
Create a SystemProperty (to handle <systemProperty> elements). -
setClasspath
public void setClasspath(org.apache.tools.ant.types.Path src) Set the classpath to use. -
createClasspath
public org.apache.tools.ant.types.Path createClasspath()Path to use for classpath. -
setClasspathRef
public void setClasspathRef(org.apache.tools.ant.types.Reference r) Adds a reference to a classpath defined elsewhere. -
setPluginList
public void setPluginList(org.apache.tools.ant.types.Path src) the plugin list to use. -
createPluginList
public org.apache.tools.ant.types.Path createPluginList()Path to use for plugin list. -
setPluginListRef
public void setPluginListRef(org.apache.tools.ant.types.Reference r) Adds a reference to a plugin list defined elsewhere. -
execute
public void execute() throws org.apache.tools.ant.BuildException- Overrides:
executein classorg.apache.tools.ant.Task- Throws:
org.apache.tools.ant.BuildException
-
checkParameters
protected void checkParameters()Check that all required attributes have been set. -
createFindbugsEngine
protected void createFindbugsEngine()Create the FindBugs engine (the Java process that will run whatever FindBugs-related program this task is going to execute). -
getFindbugsEngine
protected org.apache.tools.ant.taskdefs.Java getFindbugsEngine()Get the Findbugs engine. -
addArg
Add an argument to the JVM used to execute FindBugs.- Parameters:
arg- the argument
-
setInputString
Sets the given string to be piped to standard input of the FindBugs JVM upon launching. -
configureFindbugsEngine
protected abstract void configureFindbugsEngine() -
beforeExecuteJavaProcess
protected abstract void beforeExecuteJavaProcess() -
afterExecuteJavaProcess
protected void afterExecuteJavaProcess(int rc)
-