Java Doc for TexenTask.java in  » Template-Engine » Velocity » org » apache » velocity » texen » ant » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Template Engine » Velocity » org.apache.velocity.texen.ant 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.velocity.texen.ant.TexenTask

TexenTask
public class TexenTask extends Task (Code)
An ant task for generating output by using Velocity
author:
   Jason van Zyl
author:
   Robert Burrell Donkin
version:
   $Id: TexenTask.java 463298 2006-10-12 16:10:32Z henning $


Field Summary
protected  ExtendedPropertiescontextProperties
    

These are properties that are fed into the initial context from a properties file.

protected  StringcontrolTemplate
     This is the control template that governs the output.
protected  StringinputEncoding
     This is the encoding for the input file(s) (templates).
protected  StringlogFile
     The LogFile (incl.
protected  StringoutputDirectory
     This is where texen will place all the output that is a product of the generation process.
protected  StringoutputEncoding
     This is the encoding for the output file(s).
protected  StringoutputFile
     This is the file where the generated text will be placed.
protected  StringresourceLoaderModificationCheckInterval
    
protected  StringtemplatePath
     This is where Velocity will look for templates using the file template loader.
protected  booleanuseClasspath
     Property which controls whether the classpath will be used when trying to locate templates.
protected  StringuseResourceLoaderCache
     Property which controls whether the resource loader will be told to cache.


Method Summary
protected  voidcleanup()
     A hook method called at the end of TexenTask.execute() which can be overridden to perform any necessary cleanup activities (such as the release of database connections, etc.).
public  voidexecute()
    
public  ExtendedPropertiesgetContextProperties()
     Get the context properties that will be fed into the initial context be the generating process starts.
public  StringgetControlTemplate()
     Get the control template for the generating process.
public  StringgetLogFile()
     Gets the log file.
public  StringgetOutputDirectory()
     Get the output directory.
public  StringgetOutputFile()
     Get the output file for the generation process.
public  StringgetTemplatePath()
     Get the path where Velocity will look for templates using the file template loader.
public  ContextinitControlContext()
     Creates a VelocityContext.
protected  voidpopulateInitialContext(Context context)
    

Place useful objects into the initial context.

TexenTask places Date().toString() into the context as $now.

public  voidsetContextProperties(String file)
     Set the context properties that will be fed into the initial context be the generating process starts.
public  voidsetControlTemplate(String controlTemplate)
     [REQUIRED] Set the control template for the generating process.
public  voidsetInputEncoding(String inputEncoding)
     Set the input (template) encoding.
public  voidsetLogFile(String log)
     Sets the log file.
public  voidsetOutputDirectory(File outputDirectory)
     [REQUIRED] Set the output directory.
public  voidsetOutputEncoding(String outputEncoding)
     Set the output encoding.
public  voidsetOutputFile(String outputFile)
     [REQUIRED] Set the output file for the generation process.
public  voidsetResourceLoaderModificationCheckInterval(String resourceLoaderModificationCheckInterval)
    
public  voidsetTemplatePath(String templatePath)
     [REQUIRED] Set the path where Velocity will look for templates using the file template loader.
public  voidsetUseClasspath(boolean useClasspath)
    
public  voidsetUseResourceLoaderCache(String useResourceLoaderCache)
    

Field Detail
contextProperties
protected ExtendedProperties contextProperties(Code)

These are properties that are fed into the initial context from a properties file. This is simply a convenient way to set some values that you wish to make available in the context.

These values are not critical, like the template path or output path, but allow a convenient way to set a value that may be specific to a particular generation task.

For example, if you are generating scripts to allow user to automatically create a database, then you might want the $databaseName to be placed in the initial context so that it is available in a script that might look something like the following:

 #!bin/sh
 echo y | mysqladmin create $databaseName
 
The value of $databaseName isn't critical to output, and you obviously don't want to change the ant task to simply take a database name. So initial context values can be set with properties file.



controlTemplate
protected String controlTemplate(Code)
This is the control template that governs the output. It may or may not invoke the services of worker templates.



inputEncoding
protected String inputEncoding(Code)
This is the encoding for the input file(s) (templates).



logFile
protected String logFile(Code)
The LogFile (incl. path) to log to.



outputDirectory
protected String outputDirectory(Code)
This is where texen will place all the output that is a product of the generation process.



outputEncoding
protected String outputEncoding(Code)
This is the encoding for the output file(s).



outputFile
protected String outputFile(Code)
This is the file where the generated text will be placed.



resourceLoaderModificationCheckInterval
protected String resourceLoaderModificationCheckInterval(Code)



templatePath
protected String templatePath(Code)
This is where Velocity will look for templates using the file template loader.



useClasspath
protected boolean useClasspath(Code)
Property which controls whether the classpath will be used when trying to locate templates.



useResourceLoaderCache
protected String useResourceLoaderCache(Code)
Property which controls whether the resource loader will be told to cache. Default false





Method Detail
cleanup
protected void cleanup() throws Exception(Code)
A hook method called at the end of TexenTask.execute() which can be overridden to perform any necessary cleanup activities (such as the release of database connections, etc.). By default, does nothing.
exception:
  Exception - Problem cleaning up.



execute
public void execute() throws BuildException(Code)
Execute the input script with Velocity
throws:
  BuildException - BuildExceptions are thrown when required attributes are missing.Exceptions thrown by Velocity are rethrown as BuildExceptions.



getContextProperties
public ExtendedProperties getContextProperties()(Code)
Get the context properties that will be fed into the initial context be the generating process starts. The current context properties.



getControlTemplate
public String getControlTemplate()(Code)
Get the control template for the generating process. The current control template.



getLogFile
public String getLogFile()(Code)
Gets the log file. The log file.



getOutputDirectory
public String getOutputDirectory()(Code)
Get the output directory. The output directory.



getOutputFile
public String getOutputFile()(Code)
Get the output file for the generation process. The output file.



getTemplatePath
public String getTemplatePath()(Code)
Get the path where Velocity will look for templates using the file template loader. The template path.



initControlContext
public Context initControlContext() throws Exception(Code)
Creates a VelocityContext. new Context
throws:
  Exception - the execute method will catchand rethrow as a BuildException



populateInitialContext
protected void populateInitialContext(Context context) throws Exception(Code)

Place useful objects into the initial context.

TexenTask places Date().toString() into the context as $now. Subclasses who want to vary the objects in the context should override this method.

$generator is not put into the context in this method.


Parameters:
  context - The context to populate, as retrieved fromTexenTask.initControlContext().
throws:
  Exception - Error while populating context. The TexenTask.execute() method will catch and rethrow as aBuildException.



setContextProperties
public void setContextProperties(String file)(Code)
Set the context properties that will be fed into the initial context be the generating process starts.
Parameters:
  file -



setControlTemplate
public void setControlTemplate(String controlTemplate)(Code)
[REQUIRED] Set the control template for the generating process.
Parameters:
  controlTemplate -



setInputEncoding
public void setInputEncoding(String inputEncoding)(Code)
Set the input (template) encoding.
Parameters:
  inputEncoding -



setLogFile
public void setLogFile(String log)(Code)
Sets the log file.
Parameters:
  log -



setOutputDirectory
public void setOutputDirectory(File outputDirectory)(Code)
[REQUIRED] Set the output directory. It will be created if it doesn't exist.
Parameters:
  outputDirectory -



setOutputEncoding
public void setOutputEncoding(String outputEncoding)(Code)
Set the output encoding.
Parameters:
  outputEncoding -



setOutputFile
public void setOutputFile(String outputFile)(Code)
[REQUIRED] Set the output file for the generation process.
Parameters:
  outputFile -



setResourceLoaderModificationCheckInterval
public void setResourceLoaderModificationCheckInterval(String resourceLoaderModificationCheckInterval)(Code)

Parameters:
  resourceLoaderModificationCheckInterval -



setTemplatePath
public void setTemplatePath(String templatePath) throws Exception(Code)
[REQUIRED] Set the path where Velocity will look for templates using the file template loader.
Parameters:
  templatePath -
throws:
  Exception -



setUseClasspath
public void setUseClasspath(boolean useClasspath)(Code)
Set the use of the classpath in locating templates
Parameters:
  useClasspath - true means the classpath will be used.



setUseResourceLoaderCache
public void setUseResourceLoaderCache(String useResourceLoaderCache)(Code)

Parameters:
  useResourceLoaderCache -



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.