org.apache.tools.ant.taskdefs.optional.jsp
Class JspC

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 org.apache.tools.ant.taskdefs.MatchingTask

Ant task to run the jsp compiler.

This task takes the given jsp files and compiles them into java files. It is then up to the user to compile the java files into classes.

The task requires the srcdir and destdir attributes to be set. This Task is a MatchingTask, so the files to be compiled can be specified using includes/excludes attributes or nested include/exclude elements. Optional attributes are verbose (set the verbosity level passed to jasper), package (name of the destination package for generated java classes and classpath (the classpath to use when running the jsp compiler).

This task supports the nested elements classpath (A Path) and classpathref (A Reference) which can be used in preference to the attribute classpath, if the jsp compiler is not already in the ant classpath.

Notes

At present, this task only supports the jasper compiler. In future, other compilers will be supported by setting the jsp.compiler property.

Usage

 <jspc srcdir="${basedir}/src/war"
       destdir="${basedir}/gensrc"
       package="com.i3sp.jsp"
       verbose="9">
   <include name="**\/*.jsp" />
 </jspc>
 

Version:
$Revision: 1.1 $ $Date: 2002/03/23 00:11:54 $
Author:
Matthew Watson

Large Amount of cutting and pasting from the Javac task..., James Davidson duncan@x180.com, Robin Green greenrd@hotmail.com, Stefan Bodewig, J D Glanville


Constructor Summary
JspC()
           
 
Method Summary
 org.apache.tools.ant.types.Path createClasspath()
          Maybe creates a nested classpath element.
 void execute()
           
 org.apache.tools.ant.types.Path getClasspath()
           
 java.util.Vector getCompileList()
           
 java.io.File getDestdir()
           
 boolean getFailonerror()
          Gets the failonerror flag.
 java.lang.String getIeplugin()
           
 java.lang.String getPackage()
           
 org.apache.tools.ant.types.Path getSrcDir()
           
 java.io.File getUribase()
           
 java.io.File getUriroot()
           
 int getVerbose()
           
 boolean isMapped()
           
 void setClasspath(org.apache.tools.ant.types.Path cp)
          Set the classpath to be used for this compilation
 void setClasspathRef(org.apache.tools.ant.types.Reference r)
          Adds a reference to a CLASSPATH defined elsewhere
 void setDestdir(java.io.File destDir)
          Set the destination directory into which the JSP source files should be compiled.
 void setFailonerror(boolean fail)
          Throw a BuildException if compilation fails
 void setIeplugin(java.lang.String iepluginid_)
          Set the ieplugin id
 void setMapped(boolean mapped_)
          set the mapped flag
 void setPackage(java.lang.String pkg)
          Set the name of the package the compiled jsp files should be in
 void setSrcdir(org.apache.tools.ant.types.Path srcDir)
          Set the source dirs to find the source JSP files.
 void setUribase(java.io.File uribase)
          -uribase.
 void setUriroot(java.io.File uriroot)
          -uriroot The root directory that uri files should be resolved against, (Default is the directory jspc is invoked from)
 void setVerbose(int i)
          Set the verbose level of the compiler
 
Methods inherited from class org.apache.tools.ant.taskdefs.MatchingTask
createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, setDefaultexcludes, setExcludes, setExcludesfile, setIncludes, setIncludesfile, XsetIgnore, XsetItems
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, init, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setTaskName
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JspC

public JspC()
Method Detail

setSrcdir

public void setSrcdir(org.apache.tools.ant.types.Path srcDir)
Set the source dirs to find the source JSP files.

getSrcDir

public org.apache.tools.ant.types.Path getSrcDir()

setDestdir

public void setDestdir(java.io.File destDir)
Set the destination directory into which the JSP source files should be compiled.

getDestdir

public java.io.File getDestdir()

setPackage

public void setPackage(java.lang.String pkg)
Set the name of the package the compiled jsp files should be in

getPackage

public java.lang.String getPackage()

setVerbose

public void setVerbose(int i)
Set the verbose level of the compiler

getVerbose

public int getVerbose()

setFailonerror

public void setFailonerror(boolean fail)
Throw a BuildException if compilation fails

getFailonerror

public boolean getFailonerror()
Gets the failonerror flag.

getIeplugin

public java.lang.String getIeplugin()

setIeplugin

public void setIeplugin(java.lang.String iepluginid_)
Set the ieplugin id

isMapped

public boolean isMapped()

setMapped

public void setMapped(boolean mapped_)
set the mapped flag

setUribase

public void setUribase(java.io.File uribase)
-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

getUribase

public java.io.File getUribase()

setUriroot

public void setUriroot(java.io.File uriroot)
-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

getUriroot

public java.io.File getUriroot()

setClasspath

public void setClasspath(org.apache.tools.ant.types.Path cp)
Set the classpath to be used for this compilation

createClasspath

public org.apache.tools.ant.types.Path createClasspath()
Maybe creates a nested classpath element.

setClasspathRef

public void setClasspathRef(org.apache.tools.ant.types.Reference r)
Adds a reference to a CLASSPATH defined elsewhere

getClasspath

public org.apache.tools.ant.types.Path getClasspath()

getCompileList

public java.util.Vector getCompileList()

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Overrides:
execute in class org.apache.tools.ant.Task


Copyright © 2001 i3SP Pty. Ltd. All Rights Reserved.