public abstract class AbstractTask
extends org.apache.tools.ant.taskdefs.MatchingTask
<config&rt;
tag, which uses
the configuration as a bean-like task. E.g., you can do:
<mytask&rt;
<config connectionUserName="foo"/&rt;
</mytask&rt;
The default configuration for the system will be used if the
<config&rt;
subtask is excluded.Modifier and Type | Field and Description |
---|---|
protected org.apache.tools.ant.types.Path |
classpath |
protected List<org.apache.tools.ant.types.FileSet> |
fileSets |
protected boolean |
haltOnError |
protected boolean |
isolate |
protected boolean |
useParent |
Constructor and Description |
---|
AbstractTask() |
Modifier and Type | Method and Description |
---|---|
void |
addFileset(org.apache.tools.ant.types.FileSet set) |
protected void |
assertFiles(String[] files)
Helper method to throw a standard exception if the task is not given
any files to execute on.
|
org.apache.tools.ant.types.Path |
createClasspath() |
Object |
createConfig() |
void |
execute() |
protected abstract void |
executeOn(String[] files)
Perform the task action on the given files.
|
protected ClassLoader |
getClassLoader()
Return the classloader to use.
|
Configuration |
getConfiguration()
The task configuration.
|
protected abstract ConfigurationImpl |
newConfiguration()
Implement this method to return a configuration object for the
product in use.
|
void |
setClasspath(org.apache.tools.ant.types.Path classPath) |
void |
setHaltOnError(boolean haltOnError)
Set whether we want the task to ignore all errors.
|
void |
setIsolate(boolean isolate)
Whether we want the ClassLoader to be isolated from
all other ClassLoaders
|
void |
setUseParentClassloader(boolean useParent)
Whether we want to delegate to the parent ClassLoader
for resolveing classes.
|
add, addAnd, addContains, addContainsRegexp, addCustom, addDate, addDepend, addDepth, addDifferent, addFilename, addMajority, addModified, addNone, addNot, addOr, addPresent, addSelector, addSize, addType, appendSelector, createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, getDirectoryScanner, getImplicitFileSet, getSelectors, hasSelectors, selectorCount, selectorElements, setCaseSensitive, setDefaultexcludes, setExcludes, setExcludesfile, setFollowSymlinks, setIncludes, setIncludesfile, setProject, XsetIgnore, XsetItems
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
protected final List<org.apache.tools.ant.types.FileSet> fileSets
protected boolean haltOnError
protected org.apache.tools.ant.types.Path classpath
protected boolean useParent
protected boolean isolate
public void setHaltOnError(boolean haltOnError)
public void setIsolate(boolean isolate)
public void setUseParentClassloader(boolean useParent)
public Configuration getConfiguration()
protected abstract ConfigurationImpl newConfiguration()
protected abstract void executeOn(String[] files) throws Exception
Exception
protected ClassLoader getClassLoader()
protected void assertFiles(String[] files)
executeOn(java.lang.String[])
to validate that they are given
files to work on.public void setClasspath(org.apache.tools.ant.types.Path classPath)
public org.apache.tools.ant.types.Path createClasspath()
public Object createConfig()
public void addFileset(org.apache.tools.ant.types.FileSet set)
public void execute() throws org.apache.tools.ant.BuildException
execute
in class org.apache.tools.ant.Task
org.apache.tools.ant.BuildException
Copyright © 2006–2019 Apache Software Foundation. All rights reserved.