|
||||||||
| 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.sandev.sandbuild.SandTask
org.sandev.sandbuild.SandJavadoc
public class SandJavadoc
Ant task to run Javadoc in the same VM as Ant. This task relies on
the programmatic interface to Javadoc introduced in Javadoc 1.4. Not
all doclet parameters are explicitly supported; use the
additionalparams parameter to pass through anything that
is not explicitely covered.
This task uses the Ant Javadoc task, but just to hold values for setup. The actual call to javadoc is done here. The description of how to do this can be found under "Tool Documentation" -> javadoc -> "Standard Doclet" -> "running programmatically. This description shifts around a bit with each J2SE release, but that's where it was as of this writing.
| Field Summary | |
|---|---|
protected java.lang.String |
additionalparam
Additional javadoc params can be passed via the additionalParam element. |
protected org.apache.tools.ant.types.Path |
classpath
Classpath |
protected java.lang.String |
csvsourcefiles
Takes a list of source file names, separated by commas, to use as the doclet source. |
protected java.io.File |
destdir
Destination dir |
protected org.apache.tools.ant.taskdefs.Javadoc.DocletInfo |
doclet
Doclet code |
protected boolean |
failonerror
True if the task should fail when an error occurs. |
protected org.apache.tools.ant.types.Path |
sourcepath
Source path |
protected java.lang.String |
subpackages
Package names to run Javadoc on. |
| Fields inherited from class org.apache.tools.ant.Task |
|---|
description, location, target, taskName, taskType, wrapper |
| Fields inherited from class org.apache.tools.ant.ProjectComponent |
|---|
project |
| Constructor Summary | |
|---|---|
SandJavadoc()
|
|
| Method Summary | |
|---|---|
protected java.lang.String |
array2Path(java.lang.String[] path)
Return an array of path elements as a single path string |
org.apache.tools.ant.types.Path |
createClasspath()
|
org.apache.tools.ant.taskdefs.Javadoc.DocletInfo |
createDoclet()
|
protected void |
diagnoseMethodAccess(java.lang.Class dc,
java.lang.String methodName,
java.lang.Class[] paramTypes)
Try and figure out what access we have to the defined method. |
protected void |
dumpCallSummary(java.lang.String docletName,
java.lang.String docletPath)
Dump out a summary of the environment and such for the call |
protected void |
dumpClassLoaderInfo(java.lang.String leadText,
java.lang.ClassLoader cl,
boolean dumpSearchPath)
Dump out some descriptive info about the specified ClassLoader. |
void |
dumpSearchPath(java.net.URLClassLoader ucl)
Utility method to dump the current search path elements. |
void |
execute()
Do our thing. |
protected void |
fixEnvironment()
To avoid issues with duplicate class loadings, we trim down the additional environment that the doclet invocation references. |
java.lang.String |
getToolsJarName()
Return the name of the tools jar file. |
java.net.URL |
getToolsURL()
Return the tools URL. |
protected void |
pln(java.lang.String text)
Just in case we want to hook this output for debugging, or make everything quiet. |
protected void |
prepareForExec(java.lang.String docletName,
java.lang.String docletPath)
Do what is necessary to make the exec call work. |
void |
setAdditionalparam(java.lang.String str)
|
void |
setClasspath(org.apache.tools.ant.types.Path cp)
|
void |
setClasspathRef(org.apache.tools.ant.types.Reference r)
|
void |
setCsvsourcefiles(java.lang.String files)
|
void |
setDestdir(java.io.File dir)
|
void |
setDoclet(java.lang.String src)
|
void |
setDocletPath(org.apache.tools.ant.types.Path src)
|
void |
setDocletPathRef(org.apache.tools.ant.types.Reference r)
|
void |
setFailonerror(boolean foe)
|
void |
setSourcepath(org.apache.tools.ant.types.Path src)
|
void |
setSubpackages(java.lang.String str)
|
protected void |
testInvoke(java.lang.String docletClassName,
java.lang.String docletPath)
A test invocation mirroring how our doclet actually gets called. |
void |
testLoadClass(java.lang.String docletName,
java.lang.String[] pathElems)
Attempt to load our doclet and make sure it has a start method that can be found. |
java.lang.ClassLoader |
verifyClassLoaderPath(java.net.URLClassLoader ucl,
java.lang.String[] pathElems)
Verify all the pathElems are loaded so the calls work. |
void |
verifyClassLoading(java.lang.String docletName,
org.apache.tools.ant.types.Path classpath)
Loading the class is no prob. |
| Methods inherited from class org.apache.tools.ant.Task |
|---|
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 org.apache.tools.ant.types.Path sourcepath
protected java.lang.String csvsourcefiles
sourcefiles parameter which works provided each full
filename is separated by a comma character and nothing else (no
whitespace). The javadoc tool itself specifies a
sourcefilenames parameter, which states that each
filename must be separated by spaces. Since Ant uses CSV, we specify the same format here: full
filename specifications separated by commas and no whitespace.
The comma characters are converted to space characters and the
resulting text is passed to com.sun.tools.javadoc.Main
protected org.apache.tools.ant.types.Path classpath
protected java.io.File destdir
protected boolean failonerror
protected java.lang.String subpackages
protected java.lang.String additionalparam
protected org.apache.tools.ant.taskdefs.Javadoc.DocletInfo doclet
| Constructor Detail |
|---|
public SandJavadoc()
| Method Detail |
|---|
public void setSourcepath(org.apache.tools.ant.types.Path src)
public void setCsvsourcefiles(java.lang.String files)
public void setClasspath(org.apache.tools.ant.types.Path cp)
public org.apache.tools.ant.types.Path createClasspath()
public void setClasspathRef(org.apache.tools.ant.types.Reference r)
public void setDestdir(java.io.File dir)
public void setFailonerror(boolean foe)
public void setSubpackages(java.lang.String str)
public void setAdditionalparam(java.lang.String str)
public void setDoclet(java.lang.String src)
public void setDocletPath(org.apache.tools.ant.types.Path src)
public void setDocletPathRef(org.apache.tools.ant.types.Reference r)
public org.apache.tools.ant.taskdefs.Javadoc.DocletInfo createDoclet()
protected void prepareForExec(java.lang.String docletName,
java.lang.String docletPath)
throws org.apache.tools.ant.BuildException
You can't modify the ClassLoader for a Class, but you may be allowed to modify the ClassLoader for a Thread depending on security.
org.apache.tools.ant.BuildExceptionprotected void pln(java.lang.String text)
protected void fixEnvironment()
protected void dumpCallSummary(java.lang.String docletName,
java.lang.String docletPath)
throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
protected void dumpClassLoaderInfo(java.lang.String leadText,
java.lang.ClassLoader cl,
boolean dumpSearchPath)
public void dumpSearchPath(java.net.URLClassLoader ucl)
protected java.lang.String array2Path(java.lang.String[] path)
protected void testInvoke(java.lang.String docletClassName,
java.lang.String docletPath)
This method generally shouldn't be called, but when something stops working it might give an idea as to why.
protected void diagnoseMethodAccess(java.lang.Class dc,
java.lang.String methodName,
java.lang.Class[] paramTypes)
public void verifyClassLoading(java.lang.String docletName,
org.apache.tools.ant.types.Path classpath)
throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
public void testLoadClass(java.lang.String docletName,
java.lang.String[] pathElems)
throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
public java.lang.ClassLoader verifyClassLoaderPath(java.net.URLClassLoader ucl,
java.lang.String[] pathElems)
throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildExceptionpublic java.lang.String getToolsJarName()
public java.net.URL getToolsURL()
public void execute()
throws org.apache.tools.ant.BuildException
execute in class org.apache.tools.ant.Taskorg.apache.tools.ant.BuildException
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||