Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.MatchingTask
org.apache.tools.ant.taskdefs.optional.jsp.JspC
public class JspC
extends MatchingTask
<jspc srcdir="${basedir}/src/war" destdir="${basedir}/gensrc" package="com.i3sp.jsp" verbose="9"> <include name="**\/*.jsp" /> </jspc>Large Amount of cutting and pasting from the Javac task...
Nested Class Summary | |
static class |
|
Field Summary | |
protected Vector | |
protected boolean |
|
protected JspC.WebAppParameter |
|
Fields inherited from class org.apache.tools.ant.taskdefs.MatchingTask | |
fileset |
Fields inherited from class org.apache.tools.ant.ProjectComponent | |
description , location , project |
Method Summary | |
void |
|
Path |
|
Path |
|
void |
|
void |
|
Path |
|
Vector |
|
Path |
|
File |
|
boolean |
|
String |
|
String |
|
Path |
|
File |
|
File |
|
int |
|
JspC.WebAppParameter |
|
File |
|
File |
|
boolean |
|
protected File |
|
protected void |
|
protected void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void | |
void |
|
void |
|
void |
|
void |
|
void |
|
Methods inherited from class org.apache.tools.ant.taskdefs.MatchingTask | |
XsetIgnore , XsetItems , 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 |
Methods inherited from class org.apache.tools.ant.Task | |
bindToOwner , execute , getOwningTarget , getRuntimeConfigurableWrapper , getTaskName , getTaskType , getWrapper , handleErrorFlush , handleErrorOutput , handleFlush , handleInput , handleOutput , init , isInvalid , log , log , log , log , maybeConfigure , perform , reconfigure , setOwningTarget , setRuntimeConfigurableWrapper , setTaskName , setTaskType |
Methods inherited from class org.apache.tools.ant.ProjectComponent | |
clone , getDescription , getLocation , getProject , log , log , setDescription , setLocation , setProject |
protected Vector compileList
protected boolean failOnError
flag to control action on execution trouble
public void addWebApp(JspC.WebAppParameter webappParam) throws BuildException
Adds a single webapp.
- Parameters:
webappParam
- add a web app parameter
- Throws:
BuildException
- if more than one webapp is specified.
public Path createClasspath()
Adds a path to the classpath.
- Returns:
- a path to be configured.
public Path createCompilerclasspath()
Support nested compiler classpath, used to locate compiler adapter
- Returns:
- a path to be configured.
public void deleteEmptyJavaFiles()
delete any java output files that are empty this is to get around a little defect in jasper: when it fails, it leaves incomplete files around.
public void execute() throws BuildException
execute by building up a list of files that have changed and hand them off to a jsp compiler
- Throws:
BuildException
- on error.
public Vector getCompileList()
get the list of files to compile
- Returns:
- the list of files.
public Path getCompilerclasspath()
get the classpath used to find the compiler adapter
- Returns:
- the compiler classpath.
public File getDestdir()
Get the destination directory.
- Returns:
- the directory.
public boolean getFailonerror()
Gets the failonerror flag.
- Returns:
- the flag.
public String getIeplugin()
Get the IE CLASSID value.
- Returns:
- the value.
public String getPackage()
Get the name of the package.
- Returns:
- the package.
public File getUribase()
Get the uri base value.
- Returns:
- the value.
public File getUriroot()
Get the uri root value.
- Returns:
- the value.
public int getVerbose()
Get the verbose level.
- Returns:
- the level.
public File getWebinc()
Get the webinc attribute.
- Returns:
- the webinc attribute.
public File getWebxml()
Filename for web.xml.
- Returns:
- The filename for web.xml.
public boolean isMapped()
If true, generate separate write() calls for each HTML line in the JSP.
- Returns:
- mapping status
protected File mapToJavaFile(JspMangler mangler, File srcFile, File srcDir, File dest)
get a filename from our jsp file.
- Parameters:
mangler
- the jsp filename managler.srcFile
- the source file.srcDir
- the source directory.dest
- the destination directory.
- Returns:
- the filename.
To do:
- support packages and subdirs
protected void resetFileLists()
Clear the list of files to be compiled and copied..
protected void scanDir(File srcDir, File dest, JspMangler mangler, String[] files)
Scans the directory looking for source files to be compiled. The results are returned in the class variable compileList
- Parameters:
srcDir
- the source directory.dest
- the destination directory.mangler
- the jsp filename mangler.files
- the file names to mangle.
public void setClasspath(Path cp)
Set the classpath to be used for this compilation.
- Parameters:
cp
- the path to be used.
public void setClasspathRef(Reference r)
Adds a reference to a classpath defined elsewhere
- Parameters:
r
- a reference to a classpath.
public void setCompiler(String compiler)
Class name of a JSP compiler adapter.
- Parameters:
compiler
- the compiler class name.
public void setCompilerclasspath(Path cp)
Set the classpath to be used to find this compiler adapter
- Parameters:
cp
- the compiler classpath.
public void setDestdir(File destDir)
Set the destination directory into which the JSP source files should be compiled.
- Parameters:
destDir
- the destination directory.
public void setFailonerror(boolean fail)
Whether or not the build should halt if compilation fails. Defaults totrue
.
- Parameters:
fail
- aboolean
value.
public void setIeplugin(String iepluginid)
Java Plugin CLASSID for Internet Explorer
- Parameters:
iepluginid
- the id to use.
public void setMapped(boolean mapped)
If true, generate separate write() calls for each HTML line in the JSP.
- Parameters:
mapped
- aboolean
value.
public void setPackage(String pkg)
Set the name of the package the compiled jsp files should be in.
- Parameters:
pkg
- the name of the package.
public void setSrcDir(Path srcDir)
Set the path for source JSP files.
- Parameters:
srcDir
- the source path.
public void setUribase(File uribase)
The URI context of relative URI references in the JSP pages. If it does not exist then it is derived from the location of the file relative to the declared or derived value of uriroot.
- Parameters:
uribase
- The new Uribase value
public void setUriroot(File uriroot)
The root directory that uri files should be resolved against. (Default is the directory jspc is invoked from)
- Parameters:
uriroot
- The new Uribase value
public void setVerbose(int i)
Set the verbose level of the compiler
- Parameters:
i
- the verbose level to use.
public void setWebinc(File webinc)
output filename for the fraction of web.xml that lists servlets.
- Parameters:
webinc
- The new Webinc value
public void setWebxml(File webxml)
Filename for web.xml.
- Parameters:
webxml
- The new Webxml value