Package org.apache.openjpa.lib.ant
Class AbstractTask
- java.lang.Object
-
- org.apache.tools.ant.ProjectComponent
-
- org.apache.tools.ant.Task
-
- org.apache.tools.ant.taskdefs.MatchingTask
-
- org.apache.openjpa.lib.ant.AbstractTask
-
- All Implemented Interfaces:
java.lang.Cloneable,org.apache.tools.ant.types.selectors.SelectorContainer
- Direct Known Subclasses:
ApplicationIdToolTask,MappingToolTask,MetaDataToolTask,PCEnhancerTask,ReverseMappingToolTask,SchemaToolTask
public abstract class AbstractTask extends org.apache.tools.ant.taskdefs.MatchingTaskAnt tasks all have a nested<config&rt;tag, which uses the configuration as a bean-like task. E.g., you can do:<mytask&rt;The default configuration for the system will be used if the
<config connectionUserName="foo"/&rt;
</mytask&rt;<config&rt;subtask is excluded.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.tools.ant.types.Pathclasspathprotected java.util.List<org.apache.tools.ant.types.FileSet>fileSetsprotected booleanhaltOnErrorprotected booleanisolateprotected booleanuseParent
-
Constructor Summary
Constructors Constructor Description AbstractTask()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddFileset(org.apache.tools.ant.types.FileSet set)protected voidassertFiles(java.lang.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.PathcreateClasspath()java.lang.ObjectcreateConfig()voidexecute()protected abstract voidexecuteOn(java.lang.String[] files)Perform the task action on the given files.protected java.lang.ClassLoadergetClassLoader()Return the classloader to use.ConfigurationgetConfiguration()The task configuration.protected abstract ConfigurationImplnewConfiguration()Implement this method to return a configuration object for the product in use.voidsetClasspath(org.apache.tools.ant.types.Path classPath)voidsetHaltOnError(boolean haltOnError)Set whether we want the task to ignore all errors.voidsetIsolate(boolean isolate)Whether we want the ClassLoader to be isolated from all other ClassLoadersvoidsetUseParentClassloader(boolean useParent)Whether we want to delegate to the parent ClassLoader for resolveing classes.-
Methods inherited from class org.apache.tools.ant.taskdefs.MatchingTask
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
-
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, setTaskType
-
-
-
-
Method Detail
-
setHaltOnError
public void setHaltOnError(boolean haltOnError)
Set whether we want the task to ignore all errors.
-
setIsolate
public void setIsolate(boolean isolate)
Whether we want the ClassLoader to be isolated from all other ClassLoaders
-
setUseParentClassloader
public void setUseParentClassloader(boolean useParent)
Whether we want to delegate to the parent ClassLoader for resolveing classes. This may "taint" classes.
-
getConfiguration
public Configuration getConfiguration()
The task configuration.
-
newConfiguration
protected abstract ConfigurationImpl newConfiguration()
Implement this method to return a configuration object for the product in use.
-
executeOn
protected abstract void executeOn(java.lang.String[] files) throws java.lang.ExceptionPerform the task action on the given files.- Throws:
java.lang.Exception
-
getClassLoader
protected java.lang.ClassLoader getClassLoader()
Return the classloader to use.
-
assertFiles
protected void assertFiles(java.lang.String[] files)
Helper method to throw a standard exception if the task is not given any files to execute on. Implementations might call this method as the first step inexecuteOn(java.lang.String[])to validate that they are given files to work on.
-
setClasspath
public void setClasspath(org.apache.tools.ant.types.Path classPath)
-
createClasspath
public org.apache.tools.ant.types.Path createClasspath()
-
createConfig
public java.lang.Object createConfig()
-
addFileset
public void addFileset(org.apache.tools.ant.types.FileSet set)
-
execute
public void execute() throws org.apache.tools.ant.BuildException- Overrides:
executein classorg.apache.tools.ant.Task- Throws:
org.apache.tools.ant.BuildException
-
-