Package org.datanucleus.enhancer
Class EnhancerTask
- java.lang.Object
-
- org.apache.tools.ant.ProjectComponent
-
- org.apache.tools.ant.Task
-
- org.apache.tools.ant.taskdefs.Java
-
- org.datanucleus.enhancer.EnhancerTask
-
- All Implemented Interfaces:
java.lang.Cloneable
public class EnhancerTask extends org.apache.tools.ant.taskdefs.JavaEnhancer Ant Task.
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.Filedir(package private) java.util.List<org.apache.tools.ant.types.FileSet>filesetsFilesets of metadata files or class files to be enhanced.private java.lang.StringfileSuffixesThe suffixes of the files to use.private java.lang.StringifpropertysetOnly runs this task if the property is set.
-
Constructor Summary
Constructors Constructor Description EnhancerTask()Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFileSet(org.apache.tools.ant.types.FileSet fs)Add a fileset.voidexecute()Execution methodjava.io.FilegetDir()Gets the root dir for looking for filesprivate org.apache.tools.ant.DirectoryScannergetDirectoryScanner(java.io.File dir)protected java.io.File[]getFiles()voidsetAlwaysDetachable(boolean detachable)set always detachable.voidsetApi(java.lang.String api)set API AdaptervoidsetCheckonly(boolean checkonly)Whether to just check the enhancement statevoidsetDestination(java.io.File destdir)set output directoryvoidsetDetachListener(boolean flag)Whether to use detach listener.voidsetDir(java.io.File dir)Sets the root dir for looking for filesvoidsetFileSuffixes(java.lang.String suffixes)Set one or more file suffixes for the input files.voidsetGenerateConstructor(boolean flag)Whether to allow generation of default constructor where required.voidsetGeneratePK(boolean flag)Whether to allow generation of PKs where required.voidsetIf(java.lang.String ifpropertyset)voidsetPersistenceUnit(java.lang.String unit)Set the persistence-unit name to enhancevoidsetQuiet(boolean quiet)set quietvoidsetVerbose(boolean verbose)set verbose-
Methods inherited from class org.apache.tools.ant.taskdefs.Java
addAssertions, addConfiguredRedirector, addEnv, addSysproperty, addSyspropertyset, checkConfiguration, clearArgs, createArg, createBootclasspath, createClasspath, createJvmarg, createModulepath, createPermissions, createUpgrademodulepath, createWatchdog, executeJava, executeJava, getCommandLine, getSysProperties, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, maybeSetResultPropertyValue, run, setAppend, setArgs, setClassname, setClasspath, setClasspathRef, setCloneVm, setDiscardError, setDiscardOutput, setError, setErrorProperty, setFailonerror, setFork, setInput, setInputString, setJar, setJvm, setJvmargs, setJVMVersion, setLogError, setMaxmemory, setModule, setModulepath, setModulepathRef, setNewenvironment, setOutput, setOutputproperty, setResultProperty, setSourceFile, setSpawn, setTimeout, setupRedirector
-
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
-
-
-
-
Field Detail
-
dir
private java.io.File dir
-
ifpropertyset
private java.lang.String ifpropertyset
Only runs this task if the property is set.
-
fileSuffixes
private java.lang.String fileSuffixes
The suffixes of the files to use. Defaults to files suffixed "jdo".
-
filesets
java.util.List<org.apache.tools.ant.types.FileSet> filesets
Filesets of metadata files or class files to be enhanced.
-
-
Method Detail
-
execute
public void execute() throws org.apache.tools.ant.BuildExceptionExecution method- Overrides:
executein classorg.apache.tools.ant.taskdefs.Java- Throws:
org.apache.tools.ant.BuildException- Thrown when an error occurs when processing the task
-
setCheckonly
public void setCheckonly(boolean checkonly)
Whether to just check the enhancement state- Parameters:
checkonly- Whether to just check
-
setGeneratePK
public void setGeneratePK(boolean flag)
Whether to allow generation of PKs where required.- Parameters:
flag- Allow PK generation
-
setGenerateConstructor
public void setGenerateConstructor(boolean flag)
Whether to allow generation of default constructor where required.- Parameters:
flag- Allow default constructor addition
-
setDetachListener
public void setDetachListener(boolean flag)
Whether to use detach listener.- Parameters:
flag- to detach listener use
-
getDirectoryScanner
private org.apache.tools.ant.DirectoryScanner getDirectoryScanner(java.io.File dir)
-
setDestination
public void setDestination(java.io.File destdir)
set output directory- Parameters:
destdir- output dir
-
setApi
public void setApi(java.lang.String api)
set API Adapter- Parameters:
api- API Adapter
-
setPersistenceUnit
public void setPersistenceUnit(java.lang.String unit)
Set the persistence-unit name to enhance- Parameters:
unit- Name of the persistence-unit to enhance
-
setDir
public void setDir(java.io.File dir)
Sets the root dir for looking for files- Overrides:
setDirin classorg.apache.tools.ant.taskdefs.Java- Parameters:
dir- the root dir
-
getDir
public java.io.File getDir()
Gets the root dir for looking for files- Returns:
- the root dir
-
setFileSuffixes
public void setFileSuffixes(java.lang.String suffixes)
Set one or more file suffixes for the input files. Suffixes are separated with a comma(,)- Parameters:
suffixes- the suffices
-
setAlwaysDetachable
public void setAlwaysDetachable(boolean detachable)
set always detachable.- Parameters:
detachable- Whether all enhanced classes should be detachable
-
setVerbose
public void setVerbose(boolean verbose)
set verbose- Parameters:
verbose- Whether to give verbose output
-
setQuiet
public void setQuiet(boolean quiet)
set quiet- Parameters:
quiet- Whether to give no output
-
addFileSet
public void addFileSet(org.apache.tools.ant.types.FileSet fs)
Add a fileset. @see ant manual- Parameters:
fs- the FileSet
-
getFiles
protected java.io.File[] getFiles()
-
setIf
public void setIf(java.lang.String ifpropertyset)
-
-