Java Doc for Generator.java in  » Template-Engine » Velocity » org » apache » velocity » texen » 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 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.velocity.texen.Generator

Generator
public class Generator (Code)
A text/code generator class
author:
   Leon Messerschmidt
author:
   Jason van Zyl
version:
   $Id: Generator.java 463298 2006-10-12 16:10:32Z henning $


Field Summary
final public static  StringOUTPUT_PATH
     Where the texen output will placed.
final public static  StringTEMPLATE_PATH
     Where the velocity templates live.
protected  StringinputEncoding
     This is the encoding for the input file(s) (templates).
protected  StringoutputEncoding
     This is the encoding for the output file(s).
protected  VelocityEngineve
     Velocity engine.

Constructor Summary
public  Generator(String propFile)
     Create a new generator object with properties loaded from a file.
public  Generator(Properties props)
     Create a new Generator object with a given property set.

Method Summary
protected  voidfillContextDefaults(Context context)
    
protected  voidfillContextHash(Context context, Hashtable objs)
     Add all the contents of a Hashtable to the context.
protected  voidfillContextProperties(Context context)
     Add objects to the context from the current properties.
protected  ContextgetContext(Hashtable objs)
     Create a new context and fill it with the elements of the objs Hashtable.
public static  GeneratorgetInstance()
     Create a new generator object with default properties.
public  StringgetOutputPath()
     Get the output path for the generated output.
public  TemplategetTemplate(String templateName, String encoding)
     Returns a template, based on encoding and path.
public  StringgetTemplatePath()
     Get the template path.
public  WritergetWriter(String path, String encoding)
     Returns a writer, based on encoding and path.
public  Stringparse(String inputTemplate, String outputFile)
     Parse an input and write the output to an output file.
public  Stringparse(String inputTemplate, String outputFile, String objectID, Object object)
     Parse an input and write the output to an output file.
public  Stringparse(String inputTemplate, String inputEncoding, String outputFile, String outputEncoding, String objectID, Object object)
     Parse an input and write the output to an output file.
public  Stringparse(String controlTemplate, Context controlContext)
     Parse the control template and merge it with the control context.
protected  voidsetDefaultProps()
     Set default properties.
public  voidsetInputEncoding(String inputEncoding)
     Set the input (template) encoding.
public  voidsetOutputEncoding(String outputEncoding)
     Set the output encoding.
public  voidsetOutputPath(String outputPath)
     Set the output path for the generated output.
public  voidsetTemplatePath(String templatePath)
     Set the template path, where Texen will look for Velocity templates.
public  voidsetVelocityEngine(VelocityEngine ve)
     Set the velocity engine.
public  voidshutdown()
     Properly shut down the generator, right now this is simply flushing and closing the file writers that we have been holding on to.

Field Detail
OUTPUT_PATH
final public static String OUTPUT_PATH(Code)
Where the texen output will placed.



TEMPLATE_PATH
final public static String TEMPLATE_PATH(Code)
Where the velocity templates live.



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



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



ve
protected VelocityEngine ve(Code)
Velocity engine.




Constructor Detail
Generator
public Generator(String propFile)(Code)
Create a new generator object with properties loaded from a file. If the file does not exist or any other exception occurs during the reading operation the default properties are used.
Parameters:
  propFile - properties used to help populate the control context.



Generator
public Generator(Properties props)(Code)
Create a new Generator object with a given property set. The property set will be duplicated.
Parameters:
  props - properties object to help populate the control context.




Method Detail
fillContextDefaults
protected void fillContextDefaults(Context context)(Code)
Add properties that will aways be in the context by default
Parameters:
  context - control context to fill with default values.



fillContextHash
protected void fillContextHash(Context context, Hashtable objs)(Code)
Add all the contents of a Hashtable to the context.
Parameters:
  context - context to fill with objects
Parameters:
  objs - source of objects



fillContextProperties
protected void fillContextProperties(Context context)(Code)
Add objects to the context from the current properties.
Parameters:
  context - control context to fill with objectsthat are specified in the default.propertiesfile



getContext
protected Context getContext(Hashtable objs)(Code)
Create a new context and fill it with the elements of the objs Hashtable. Default objects and objects that comes from the properties of this Generator object is also added.
Parameters:
  objs - objects to place in the control context Context context filled with objects



getInstance
public static Generator getInstance()(Code)
Create a new generator object with default properties. Generator generator used in the control context.



getOutputPath
public String getOutputPath()(Code)
Get the output path for the generated output. String output path for texen output.



getTemplate
public Template getTemplate(String templateName, String encoding) throws Exception(Code)
Returns a template, based on encoding and path.
Parameters:
  templateName - name of the template
Parameters:
  encoding - template encoding A Template.
throws:
  Exception -



getTemplatePath
public String getTemplatePath()(Code)
Get the template path. String template path for velocity templates.



getWriter
public Writer getWriter(String path, String encoding) throws Exception(Code)
Returns a writer, based on encoding and path.
Parameters:
  path - path to the output file
Parameters:
  encoding - output encoding A Writer for this generator.
throws:
  Exception -



parse
public String parse(String inputTemplate, String outputFile) throws Exception(Code)
Parse an input and write the output to an output file. If the output file parameter is null or an empty string the result is returned as a string object. Otherwise an empty string is returned.
Parameters:
  inputTemplate - input template
Parameters:
  outputFile - output file The parsed file.
throws:
  Exception -



parse
public String parse(String inputTemplate, String outputFile, String objectID, Object object) throws Exception(Code)
Parse an input and write the output to an output file. If the output file parameter is null or an empty string the result is returned as a string object. Otherwise an empty string is returned. You can add objects to the context with the objs Hashtable.
Parameters:
  inputTemplate - input template
Parameters:
  outputFile - output file
Parameters:
  objectID - id for object to be placed in the control context
Parameters:
  object - object to be placed in the context String generated output from velocity
throws:
  Exception -



parse
public String parse(String inputTemplate, String inputEncoding, String outputFile, String outputEncoding, String objectID, Object object) throws Exception(Code)
Parse an input and write the output to an output file. If the output file parameter is null or an empty string the result is returned as a string object. Otherwise an empty string is returned. You can add objects to the context with the objs Hashtable.
Parameters:
  inputTemplate - input template
Parameters:
  inputEncoding - template encoding
Parameters:
  outputFile - output file
Parameters:
  outputEncoding - outputEncoding encoding of output file
Parameters:
  objectID - id for object to be placed in the control context
Parameters:
  object - object to be placed in the context String generated output from velocity
throws:
  Exception -



parse
public String parse(String controlTemplate, Context controlContext) throws Exception(Code)
Parse the control template and merge it with the control context. This is the starting point in texen.
Parameters:
  controlTemplate - control template
Parameters:
  controlContext - control context String generated output
throws:
  Exception -



setDefaultProps
protected void setDefaultProps()(Code)
Set default properties.



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



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



setOutputPath
public void setOutputPath(String outputPath)(Code)
Set the output path for the generated output.
Parameters:
  outputPath -



setTemplatePath
public void setTemplatePath(String templatePath)(Code)
Set the template path, where Texen will look for Velocity templates.
Parameters:
  templatePath - template path for velocity templates.



setVelocityEngine
public void setVelocityEngine(VelocityEngine ve)(Code)
Set the velocity engine.
Parameters:
  ve -



shutdown
public void shutdown()(Code)
Properly shut down the generator, right now this is simply flushing and closing the file writers that we have been holding on to.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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