org.ajax4jsf.builder.ant
Class JSFGeneratorTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.ajax4jsf.builder.ant.JSFGeneratorTask
All Implemented Interfaces:
java.lang.Cloneable, JSFGeneratorConfiguration

public class JSFGeneratorTask
extends org.apache.tools.ant.Task
implements JSFGeneratorConfiguration

Base Task for build componenta,renderers,faces-config,tag and tld files. for use in ant build.xml , task must be defined as : <taskdef classpathref="taskClassPath" classname="com.exadel.vcp.builder.ant.JSFGeneratorTask" name="jsfgenerator"> Where classpath for task must contain component-builder.jar, velocity-dep.jar commons-beanutils.jar and commons-digister.jar . This Task use JDK 1.5 To invoke task , put <jsfgenerator configfile="../conf/test.xml" destdir="../generated" description="Build classes and configs" > .... </jsfgenerator> mantadory attributes : configfile - point to xml configuration file with components descriptions. For detail of configuration, see META-INF/schema/component-config.dtd and ComponentBean also, can use instead FileList type child element <configs> with other config files, for syntax see Ant <folelist> element optional attributes : destdir - destination directory for generated files. If not set, must be set in nesting generation elements. templates - directory with custom templates. If template not found in this directory, use default fom jar classpath, classpathref - classpath definition for load components,tags,renderers classes for analaize properties for generation of concrete files, used nested elements : <components> generate components implementation classes com.exadel.vcp.builder.ant.ComponentGenerator <renderers> generate renderers implementation classes com.exadel.vcp.builder.ant.RendererGenerator <tags> generate jsp tags implementation classes com.exadel.vcp.builder.ant.TagGenerator <facesconfig> - generate jsf configuration file com.exadel.vcp.builder.ant.FacesConfigGenerator <taglib> generate taglib .tld file com.exadel.vcp.builder.ant.TaglibGenerator <faceletstaglib> - generate taglib for facelets com.exadel.vcp.builder.ant.FaceletsTaglibGenerator also, can use nested <classpath> element, same as javac ant task

Version:
$Revision: 1.1.2.11 $ $Date: 2007/02/26 20:49:03 $
Author:
asmirnov@exadel.com (latest modification by $Author: alexsmirnov $)

Field Summary
 
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
JSFGeneratorTask()
           
 
Method Summary
 org.apache.tools.ant.types.Path createClasspath()
           
 ComponentGenerator createComponents()
           
 org.apache.tools.ant.types.FileList createConfigs()
          Create child element for list of config files.
 FaceletsTaglibGenerator createFaceletsTaglib()
           
 FacesConfigGenerator createFacesconfig()
           
 ListenerGenerator createListenerGenerator()
           
 RendererGenerator createRenderers()
           
 TagHandlerGenerator createTagHandler()
           
 TaglibGenerator createTaglib()
           
 ComponentTagGenerator createTags()
           
 void execute()
           
 java.lang.ClassLoader getClassLoader()
           
 org.apache.tools.ant.types.Path getClasspath()
           
 java.io.File getConfigFile()
           
 java.io.File getDestDir()
           
 java.lang.String getKey()
           
 org.apache.velocity.Template getTemplate(java.lang.String name)
           
 java.io.File getTemplates()
           
 java.lang.String getTemplatesPath()
           
 void init()
           
 void setClasspath(org.apache.tools.ant.types.Path classpath)
           
 void setClasspathRef(org.apache.tools.ant.taskdefs.Ant.Reference ref)
           
 void setConfigFile(java.io.File configFile)
           
 void setDestDir(java.io.File destDir)
           
 void setKey(java.lang.String key)
           
 void setTemplates(java.io.File templates)
           
 void setTemplatesPath(java.lang.String templatesPath)
           
 
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
 

Constructor Detail

JSFGeneratorTask

public JSFGeneratorTask()
Method Detail

getConfigFile

public java.io.File getConfigFile()
Returns:
Returns the configFile.

setConfigFile

public void setConfigFile(java.io.File configFile)
Parameters:
configFile - The configFile to set.

createConfigs

public org.apache.tools.ant.types.FileList createConfigs()
Create child element for list of config files. Task Can have only one such child

Returns:

getDestDir

public java.io.File getDestDir()
Specified by:
getDestDir in interface JSFGeneratorConfiguration
Returns:
Returns the destDir.

setDestDir

public void setDestDir(java.io.File destDir)
Parameters:
destDir - The destDir to set.

getTemplates

public java.io.File getTemplates()
Returns:
Returns the templates.

setTemplates

public void setTemplates(java.io.File templates)
Parameters:
templates - The templates to set.

getClasspath

public org.apache.tools.ant.types.Path getClasspath()
Returns:
Returns the classpath.

setClasspath

public void setClasspath(org.apache.tools.ant.types.Path classpath)
Parameters:
classpath - The classpath to set.

createClasspath

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

setClasspathRef

public void setClasspathRef(org.apache.tools.ant.taskdefs.Ant.Reference ref)

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

getTemplate

public org.apache.velocity.Template getTemplate(java.lang.String name)
                                         throws GeneratorException
Specified by:
getTemplate in interface JSFGeneratorConfiguration
Throws:
GeneratorException

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

getClassLoader

public java.lang.ClassLoader getClassLoader()
Specified by:
getClassLoader in interface JSFGeneratorConfiguration

createComponents

public ComponentGenerator createComponents()

createFacesconfig

public FacesConfigGenerator createFacesconfig()

createRenderers

public RendererGenerator createRenderers()

createTags

public ComponentTagGenerator createTags()

createTaglib

public TaglibGenerator createTaglib()

createFaceletsTaglib

public FaceletsTaglibGenerator createFaceletsTaglib()

createTagHandler

public TagHandlerGenerator createTagHandler()

createListenerGenerator

public ListenerGenerator createListenerGenerator()

getKey

public java.lang.String getKey()
Specified by:
getKey in interface JSFGeneratorConfiguration
Returns:
Returns the key.

setKey

public void setKey(java.lang.String key)
Parameters:
key - The key to set.

getTemplatesPath

public java.lang.String getTemplatesPath()
Specified by:
getTemplatesPath in interface JSFGeneratorConfiguration
Returns:
the templatesPath

setTemplatesPath

public void setTemplatesPath(java.lang.String templatesPath)
Parameters:
templatesPath - the templatesPath to set


Copyright © 2009. All Rights Reserved.