|
RbUtils 0.13 | |||||||||
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
org.ktc.rbutils.rb.AbstractRbTask
public abstract class AbstractRbTask
Abstract class for RbUtils ant tasks. Provides common options for check and generation. This includes logging system.
Nested Class Summary | |
---|---|
static class |
AbstractRbTask.Log
Logger for the rbUtils ant tasks. |
static class |
AbstractRbTask.LoggerType
Enumerated attribute for ant logger type. |
Field Summary | |
---|---|
protected Locale |
displayLocale
Locale for results display. |
protected String |
extension
Extension of properties file. |
protected boolean |
failOnErrors
Specifies whether the build will break if errors occur. |
protected String |
failureProperty
The name of the property to set if errors occur. |
protected List |
fileSets
Contains the filesets to process. |
protected int |
maxErrors
The maximum number of errors that are tolerated before breaking the build or setting the failure property. |
protected MainProcessor |
processor
Processor used by the task to do the job. |
protected File |
root
Root directory used to find properties file. |
protected TaskType |
taskType
The type of the Task. |
Fields inherited from class org.apache.tools.ant.Task |
---|
description, location, target, taskName, wrapper |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
---|
project |
Constructor Summary | |
---|---|
AbstractRbTask()
Instanciates a new AbstractRbTask. |
Method Summary | |
---|---|
void |
addFileset(FileSet fileSet)
Adds a set of files (nested fileset attribute). |
void |
addLogger(AbstractRbTask.Log logger)
Adds an Ant Logger. |
protected void |
doJob()
Launches the check. |
protected List |
getFiles()
Scans all optional filesets to find files to check and returns the list of found files. |
protected List |
getLoggers()
Returns the list of listeners set in this task. |
protected void |
handleErrors(int numErrors)
Handles errors. |
protected void |
logTaskStarts()
Display, via the ant loggers, that the task starts. |
void |
setDisplayLocale(String displayLocale)
Sets the locale to be used to generate message used on logging. |
void |
setExtension(String extension)
Sets the extension of the properties file used for the check. |
void |
setFailOnErrors(boolean failOnErrors)
Tells this task whether to fail if errors occur during the check. |
void |
setFailureProperty(String failureProperty)
Tells this task to set the named property to "true" when there is a violation. |
void |
setMaxErrors(int maxErrors)
Sets the maximum number of errors allowed. |
void |
setRoot(File root)
Sets the directory where the properties files will be searched for the check. |
protected abstract void |
specificTaskinitilization()
Adds specific Initialization to the task. |
Methods inherited from class org.apache.tools.ant.Task |
---|
execute, 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 |
Field Detail |
---|
protected Locale displayLocale
protected int maxErrors
protected boolean failOnErrors
protected String failureProperty
protected final List fileSets
protected File root
protected String extension
protected MainProcessor processor
protected TaskType taskType
Constructor Detail |
---|
public AbstractRbTask()
Method Detail |
---|
protected void doJob()
protected abstract void specificTaskinitilization() throws FileNotFoundException
FileNotFoundException
- if a file is not found on processor instanciation.protected void logTaskStarts()
public void addLogger(AbstractRbTask.Log logger)
logger
- the ant logger to be added for logging.protected List getLoggers() throws IOException
If no loggers are registered, creates a new DefaultLogger using the ant logging system and adds it to the returned list.
IOException
- if an error occurs.protected List getFiles()
The list contains File
objects.
protected void handleErrors(int numErrors)
If this number is greater than maxErrors, sets the failureProperty if asked and throws an
BuildException if failOnErrors is sets to true
.
numErrors
- number of errors to be check against maxErrors.public void setDisplayLocale(String displayLocale)
The separator in the String
argument must be
LocaleUtils.LOCALE_SEPARATOR
.
displayLocale
- The locale to set.public void setFailOnErrors(boolean failOnErrors)
true
.
failOnErrors
- true
to fail on errors; false
otherwise.public void setFailureProperty(String failureProperty)
failureProperty
- the name of the property to set in the event of an failure.public void setMaxErrors(int maxErrors)
maxErrors
- the maximum number of errors allowed.public void addFileset(FileSet fileSet)
fileSet
- the file set to add.public void setRoot(File root)
root
- the root directory to set.public void setExtension(String extension)
AbstractMainProcessor#DEFAULT_PROPERTIES_EXTENSION
.
extension
- the extension to set.
|
Back to the RbUtils Home Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |