|
.NET Framework | |||||||||
PREV TYPE NEXT TYPE | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONST | PROP | METHOD | OP | EVENT | DETAIL: FIELD | CONST | PROP | METHOD | OP | EVENT |
A text/code generator class
Field Summary | |
---|---|
string |
inputEncoding
This is the encoding for the input file(s) (templates). |
string |
OUTPUT_PATH
Where the texen output will placed. |
string |
outputEncoding
This is the encoding for the output file(s). |
string |
TEMPLATE_PATH
Where the velocity templates live. |
NVelocity.App.VelocityEngine |
ve
Velocity engine. |
Constructor Summary | |
---|---|
Generator() Default constructor. |
|
Generator(string propFile) 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. * |
|
Generator(Commons.Collections.ExtendedProperties props) Create a new Generator object with a given property set. The property set will be duplicated. * |
Property Summary | |
---|---|
string | InputEncoding |
NVelocity.NAnt.Texen.Generator | Instance |
string | LogPrefix |
string | OutputEncoding |
string | OutputPath |
string | TemplatePath |
NVelocity.App.VelocityEngine | VelocityEngine |
Method Summary | |
---|---|
void |
fillContextDefaults(NVelocity.Context.IContext context) Add properties that will aways be in the context by default * |
void |
fillContextHash(NVelocity.Context.IContext context, System.Collections.Hashtable objs) Add all the contents of a Hashtable to the context. * |
void |
fillContextProperties(NVelocity.Context.IContext context) Add objects to the context from the current properties. * |
NVelocity.Context.IContext |
getContext(System.Collections.Hashtable objs) 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. * |
NVelocity.Template |
getTemplate(string templateName, string encoding) Returns a template, based on encoding and path. * |
System.IO.StreamWriter |
getWriter(string path, string encoding) Returns a writer, based on encoding and path. * |
string |
parse(string controlTemplate, NVelocity.Context.IContext controlContext) Parse the control template and merge it with the control context. This is the starting point in texen. * |
string |
parse(string inputTemplate, string intputEncoding, string outputFile, string outputEncoding, string objectID, object object_Renamed) 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. * |
string |
parse(string inputTemplate, string outputFile, string objectID, object object_Renamed) 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. * |
string |
parse(string inputTemplate, string outputFile) 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. * |
void |
setDefaultProps() Set default properties. |
void |
shutdown() 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 class System.Object |
---|
Equals, Finalize, GetHashCode, GetType, MemberwiseClone, ToString |
Field Detail |
---|
protected internal string inputEncoding
This is the encoding for the input file(s) (templates).
public string OUTPUT_PATH
Where the texen output will placed.
protected internal string outputEncoding
This is the encoding for the output file(s).
public string TEMPLATE_PATH
Where the velocity templates live.
protected internal NVelocity.App.VelocityEngine ve
Velocity engine.
Constructor Detail |
---|
public Generator()
Default constructor.
public Generator(string propFile)
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:
String
- properties used to help populate the control context.
public Generator(Commons.Collections.ExtendedProperties props)
Create a new Generator object with a given property set. The property set will be duplicated. *
Parameters:
Properties
- properties object to help populate the control context.
Property Detail |
---|
public string InputEncoding
public NVelocity.NAnt.Texen.Generator Instance
public string LogPrefix
public string OutputEncoding
public string OutputPath
public string TemplatePath
public NVelocity.App.VelocityEngine VelocityEngine
Method Detail |
---|
protected internal void fillContextDefaults(NVelocity.Context.IContext context)
Add properties that will aways be in the context by default *
Parameters:
Context
- control context to fill with default values.
protected internal void fillContextHash(NVelocity.Context.IContext context, System.Collections.Hashtable objs)
Add all the contents of a Hashtable to the context. *
Parameters:
Context
- context to fill with objects
Hashtable
- source of objects
protected internal void fillContextProperties(NVelocity.Context.IContext context)
Add objects to the context from the current properties. *
Parameters:
Context
- control context to fill with objects
that are specified in the default.properties
file
protected internal NVelocity.Context.IContext getContext(System.Collections.Hashtable objs)
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:
Hashtable
- objects to place in the control context
public NVelocity.Template getTemplate(string templateName, string encoding)
Returns a template, based on encoding and path. *
Parameters:
templateName
- name of the template
encoding
- template encoding
public System.IO.StreamWriter getWriter(string path, string encoding)
Returns a writer, based on encoding and path. *
Parameters:
path
- path to the output file
encoding
- output encoding
public string parse(string controlTemplate, NVelocity.Context.IContext controlContext)
Parse the control template and merge it with the control context. This is the starting point in texen. *
Parameters:
String
- control template
Context
- control context
public string parse(string inputTemplate, string intputEncoding, string outputFile, string outputEncoding, string objectID, object object_Renamed)
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:
String
- input template
String
- inputEncoding template encoding
String
- output file
String
- outputEncoding encoding of output file
String
- id for object to be placed in the control context
String
- object to be placed in the context
public string parse(string inputTemplate, string outputFile, string objectID, object object_Renamed)
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:
String
- input template
String
- output file
String
- id for object to be placed in the control context
String
- object to be placed in the context
public string parse(string inputTemplate, string outputFile)
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:
String
- input template
String
- output file
protected internal void setDefaultProps()
Set default properties.
public void shutdown()
Properly shut down the generator, right now this is simply flushing and closing the file writers that we have been holding on to.
|
.NET Framework | |||||||||
PREV TYPE NEXT TYPE | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONST | PROP | METHOD | OP | EVENT | DETAIL: FIELD | CONST | PROP | METHOD | OP | EVENT |