FileDocCategorySizeDatePackage
DefaultJspCompilerAdapter.javaAPI DocApache Ant 1.704671Wed Dec 13 06:16:24 GMT 2006org.apache.tools.ant.taskdefs.optional.jsp.compilers

DefaultJspCompilerAdapter

public abstract class DefaultJspCompilerAdapter extends Object implements JspCompilerAdapter
This is the default implementation for the JspCompilerAdapter interface. This is currently very light on the ground since only one compiler type is supported.

Fields Summary
private static String
lSep
protected org.apache.tools.ant.taskdefs.optional.jsp.JspC
owner
our owner
Constructors Summary
Methods Summary
protected voidaddArg(org.apache.tools.ant.types.CommandlineJava cmd, java.lang.String argument)
add an argument oneple to the argument list, if the value aint null

param
cmd the command line
param
argument The argument

        if (argument != null && argument.length() != 0) {
           cmd.createArgument().setValue(argument);
        }
    
protected voidaddArg(org.apache.tools.ant.types.CommandlineJava cmd, java.lang.String argument, java.lang.String value)
add an argument tuple to the argument list, if the value aint null

param
cmd the command line
param
argument The argument
param
value the parameter

        if (value != null) {
            cmd.createArgument().setValue(argument);
            cmd.createArgument().setValue(value);
        }
    
protected voidaddArg(org.apache.tools.ant.types.CommandlineJava cmd, java.lang.String argument, java.io.File file)
add an argument tuple to the arg list, if the file parameter aint null

param
cmd the command line
param
argument The argument
param
file the parameter

        if (file != null) {
            cmd.createArgument().setValue(argument);
            cmd.createArgument().setFile(file);
        }
    
public org.apache.tools.ant.taskdefs.optional.jsp.JspCgetJspc()
get the owner

return
the owner; should never be null

        return owner;
    
public org.apache.tools.ant.ProjectgetProject()
get our project

return
owner project data

        return getJspc().getProject();
    
public booleanimplementsOwnDependencyChecking()
ask if compiler can sort out its own dependencies

return
true if the compiler wants to do its own depends

        return false;
    
protected voidlogAndAddFilesToCompile(org.apache.tools.ant.taskdefs.optional.jsp.JspC jspc, java.util.Vector compileList, org.apache.tools.ant.types.CommandlineJava cmd)
Logs the compilation parameters, adds the files to compile and logs the "niceSourceList"

param
jspc the compiler task for logging
param
compileList the list of files to compile
param
cmd the command line used


                                           
       
                                            
                                             
        jspc.log("Compilation " + cmd.describeJavaCommand(),
                 Project.MSG_VERBOSE);

        StringBuffer niceSourceList = new StringBuffer("File");
        if (compileList.size() != 1) {
            niceSourceList.append("s");
        }
        niceSourceList.append(" to be compiled:");

        niceSourceList.append(lSep);

        Enumeration e = compileList.elements();
        while (e.hasMoreElements()) {
            String arg = (String) e.nextElement();
            cmd.createArgument().setValue(arg);
            niceSourceList.append("    ");
            niceSourceList.append(arg);
            niceSourceList.append(lSep);
        }

        jspc.log(niceSourceList.toString(), Project.MSG_VERBOSE);
    
public voidsetJspc(org.apache.tools.ant.taskdefs.optional.jsp.JspC owner)
set the owner

param
owner the owner JspC compiler

        this.owner = owner;