Package com.sun.codemodel.ac
Class ACTask
- java.lang.Object
-
- org.apache.tools.ant.ProjectComponent
-
- org.apache.tools.ant.Task
-
- com.sun.codemodel.ac.ACTask
-
- All Implemented Interfaces:
java.lang.Cloneable
public class ACTask extends org.apache.tools.ant.TaskAnnotation compiler ant task.This task reads annotation classes and generate strongly-typed writers.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classACTask.ClassesNested <classes> elements.static classACTask.EndorseNested <endorse> elements.
-
Field Summary
Fields Modifier and Type Field Description private org.apache.tools.ant.types.PathclasspathUsed to load additional user-specified classes.private JCodeModelcodeModelGenerated interfaces go into this codeModel.private java.util.List<java.net.URL>endorsedJarsprivate java.io.FileoutputOutput directoryprivate java.util.List<ACTask.Classes>patternsprivate JPackagepkgThe writers will be generated into this package.private java.util.Map<java.lang.Class,JDefinedClass>queueMap from annotation classes to their writers.private java.lang.ClassLoaderuserLoaderUsed during the build to load annotation classes.
-
Constructor Summary
Constructors Constructor Description ACTask()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConfiguredClasses(ACTask.Classes c)List of classes to be handledvoidaddConfiguredEndorse(ACTask.Endorse e)List of endorsed jarsorg.apache.tools.ant.types.PathcreateClasspath()Nested <classpath> element.voidexecute()private static java.lang.StringgetShortName(java.lang.String className)Gets the short name from a fully-qualified name.private voidprocess(java.lang.String name, long timestamp)Process a file.private voidprocessDir(java.io.File dir, java.lang.String prefix)Visits a directory and looks for classes that match the specified pattern.private voidprocessJar(java.io.File jarfile)Visits a jar fil and looks for classes that match the specified pattern.private voidqueue(java.lang.String className, long timestamp)Queues a file for generation.voidsetClasspath(org.apache.tools.ant.types.Path cp)Nested <classpath> element.voidsetClasspathRef(org.apache.tools.ant.types.Reference r)voidsetDestdir(java.io.File output)voidsetPackage(java.lang.String pkgName)voidsetProject(org.apache.tools.ant.Project project)-
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
-
-
-
-
Field Detail
-
classpath
private final org.apache.tools.ant.types.Path classpath
Used to load additional user-specified classes.
-
endorsedJars
private final java.util.List<java.net.URL> endorsedJars
-
patterns
private final java.util.List<ACTask.Classes> patterns
-
userLoader
private java.lang.ClassLoader userLoader
Used during the build to load annotation classes.
-
codeModel
private JCodeModel codeModel
Generated interfaces go into this codeModel.
-
pkg
private JPackage pkg
The writers will be generated into this package.
-
output
private java.io.File output
Output directory
-
queue
private final java.util.Map<java.lang.Class,JDefinedClass> queue
Map from annotation classes to their writers.
-
-
Method Detail
-
setProject
public void setProject(org.apache.tools.ant.Project project)
- Overrides:
setProjectin classorg.apache.tools.ant.ProjectComponent
-
setPackage
public void setPackage(java.lang.String pkgName)
-
setClasspath
public void setClasspath(org.apache.tools.ant.types.Path cp)
Nested <classpath> element.
-
createClasspath
public org.apache.tools.ant.types.Path createClasspath()
Nested <classpath> element.
-
setClasspathRef
public void setClasspathRef(org.apache.tools.ant.types.Reference r)
-
setDestdir
public void setDestdir(java.io.File output)
-
addConfiguredClasses
public void addConfiguredClasses(ACTask.Classes c)
List of classes to be handled
-
addConfiguredEndorse
public void addConfiguredEndorse(ACTask.Endorse e)
List of endorsed jars
-
execute
public void execute() throws org.apache.tools.ant.BuildException- Overrides:
executein classorg.apache.tools.ant.Task- Throws:
org.apache.tools.ant.BuildException
-
processJar
private void processJar(java.io.File jarfile)
Visits a jar fil and looks for classes that match the specified pattern.
-
processDir
private void processDir(java.io.File dir, java.lang.String prefix)Visits a directory and looks for classes that match the specified pattern.- Parameters:
prefix- the package name prefix like "" or "foo/bar/"
-
process
private void process(java.lang.String name, long timestamp)Process a file.- Parameters:
name- such as "javax/xml/bind/Abc.class"
-
queue
private void queue(java.lang.String className, long timestamp)Queues a file for generation.
-
getShortName
private static java.lang.String getShortName(java.lang.String className)
Gets the short name from a fully-qualified name.
-
-