org.ajax4jsf.templatecompiler.ant
Class TemplateCompilerTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.ajax4jsf.templatecompiler.ant.TemplateCompilerTask
All Implemented Interfaces:
java.io.FilenameFilter, java.lang.Cloneable

public class TemplateCompilerTask
extends org.apache.tools.ant.Task
implements java.io.FilenameFilter

Task template compiler.

Version:
$Revision: 1.1.2.4 $ $Date: 2007/02/26 20:48:56 $
Author:
ayukhovich@exadel.com (latest modification by $Author: alexsmirnov $)

Field Summary
protected  java.util.Vector filesets
           
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
TemplateCompilerTask()
          Default constructor
 
Method Summary
 boolean accept(java.io.File dir, java.lang.String name)
          Tests if a specified file should be included in a file list.
 void addFileset(org.apache.tools.ant.types.FileSet set)
          Adds a set of files to copy.
 org.apache.tools.ant.types.Path createClasspath()
          Add a path to the classpath
 void execute()
           
 java.lang.String generateJavaClassName(java.lang.String fileTemplateName)
          Generate java class name from template filename
 java.lang.ClassLoader getClassLoader()
           
 org.apache.tools.ant.types.Path getClasspath()
          Gets the classpath to be used for this compilation.
 java.io.File getDestdir()
          getting a destDit
 java.io.File getSrcdir()
          getting srcDir
 org.apache.velocity.Template getTemplate(java.lang.String name)
           
 void init()
           
 void processTemplate(java.lang.String sFileTemplate)
           
 void setClasspath(org.apache.tools.ant.types.Path classpath)
          Set the classpath to be used for this compilation
 void setClasspathRef(org.apache.tools.ant.types.Reference ref)
          Adds a reference to a classpath defined elsewhere.
 void setDestdir(java.io.File destDir)
          setting a destDir
 void setSrcdir(java.io.File srcDir)
          setting a srcDir
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, 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, setDescription, setLocation, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

filesets

protected java.util.Vector filesets
Constructor Detail

TemplateCompilerTask

public TemplateCompilerTask()
                     throws java.lang.Exception
Default constructor

Throws:
java.lang.Exception
Method Detail

getSrcdir

public java.io.File getSrcdir()
getting srcDir

Returns:
Returns the destDir

setSrcdir

public void setSrcdir(java.io.File srcDir)
setting a srcDir

Parameters:
destDir - The srcDir to set.

getDestdir

public java.io.File getDestdir()
getting a destDit

Returns:
Returns the destDir.

setDestdir

public void setDestdir(java.io.File destDir)
setting a destDir

Parameters:
destDir - The destDir to set.

generateJavaClassName

public java.lang.String generateJavaClassName(java.lang.String fileTemplateName)
Generate java class name from template filename

Parameters:
fileTemplateName - a string contain template filename
Returns:
string contain java class name

processTemplate

public void processTemplate(java.lang.String sFileTemplate)
Parameters:
sFileTemplate -

getClassLoader

public java.lang.ClassLoader getClassLoader()

addFileset

public void addFileset(org.apache.tools.ant.types.FileSet set)
Adds a set of files to copy.

Parameters:
set - a set of files to copy

init

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

execute

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

accept

public boolean accept(java.io.File dir,
                      java.lang.String name)
Tests if a specified file should be included in a file list.

Specified by:
accept in interface java.io.FilenameFilter
Parameters:
dir - the directory in which the file was found.
name - the name of the file.
Returns:
true if and only if the name should be included in the file list; false otherwise.

getClasspath

public org.apache.tools.ant.types.Path getClasspath()
Gets the classpath to be used for this compilation.

Returns:
Returns the classpath.

setClasspath

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

Parameters:
classpath - an Ant Path object containing the compilation classpath.

setClasspathRef

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

Parameters:
ref - a reference to a classpath

createClasspath

public org.apache.tools.ant.types.Path createClasspath()
Add a path to the classpath

Returns:
a class path to be configured

getTemplate

public org.apache.velocity.Template getTemplate(java.lang.String name)
                                         throws CompilationException
Throws:
CompilationException


Copyright © 2009. All Rights Reserved.