This class provides a separate new-able instance of the Velocity template engine. The alternative model for use is using the Velocity class which employs the singleton model.
Please ensure that you call one of the init() variants. This is critical for proper behavior.
Coming soon : Velocity will call the parameter-less init() at the first use of this class if the init() wasn't explicitly called. While this will ensure that Velocity functions, it almost certainly won't function in the way you intend, so please make sure to call init().
| Constructor Summary |
|---|
|
Init-less CTOR |
|
CTOR that invokes an init(String), initializing the engine using the properties file specified |
|
CTOR that invokes an init(String), initializing the engine using the Properties specified |
| Method Summary | |
|---|---|
| void |
Add a Velocity Runtime property. |
| void |
Clear a Velocity Runtime property. |
| void |
No description provided. |
| void |
No description provided. |
| boolean |
renders the input string using the context into the output writer. |
| boolean |
Renders the input stream using the context into the output writer. |
| boolean |
Renders the input reader using the context into the output writer. |
| Object |
Return an application attribute (which can be any Object) that was set by the application in order to be accessible from any component of the system that gets a RuntimeServices. |
| Log |
Returns a convenient Log instance that wraps the current LogChute. |
| Object |
Get a Velocity Runtime property. |
| Template |
Returns a Template from the Velocity
resource management system.
|
| Template |
Returns a Template from the Velocity
resource management system.
|
| void |
No description provided. |
| void |
initialize the Velocity runtime engine, using the default properties of the Velocity distribution |
| void |
initialize the Velocity runtime engine, using default properties plus the properties in the properties file passed in as the arg |
| void |
initialize the Velocity runtime engine, using default properties plus the properties in the passed in java.util.Properties object |
| boolean |
Invokes a currently registered Velocimacro with the parms provided and places the rendered stream into the writer. |
| boolean |
Merges a template and puts the rendered stream into the writer. |
| boolean |
merges a template and puts the rendered stream into the writer |
| boolean |
Determines if a resource is accessable via the currently configured resource loaders. |
| void |
Sets an application attribute (which can be any Object) that will be accessible from any component of the system that gets a RuntimeServices. |
| void |
Set an entire configuration at once. |
| void |
Set a Velocity Runtime property. |
| boolean |
No description provided. |
| void |
No description provided. |
| Methods inherited from java.langObject |
|---|
Return an application attribute (which can be any Object) that was set by the application in order to be accessible from any component of the system that gets a RuntimeServices. This allows communication between the application environment and custom pluggable components of the Velocity engine, such as ResourceLoaders and LogChutes.
Template from the Velocity
resource management system. Template from the Velocity
resource management system.
public
boolean
invokeVelocimacro
(
String
vmName,
String
logTag,
String
[]
params,
Context
context,
Writer
writer
)
public
boolean
mergeTemplate
(
String
templateName,
String
encoding,
Context
context,
Writer
writer
)
Sets an application attribute (which can be any Object) that will be accessible from any component of the system that gets a RuntimeServices. This allows communication between the application environment and custom pluggable components of the Velocity engine, such as ResourceLoaders and LogChutes.
Note that there is no enforcement or rules for the key used - it is up to the application developer. However, to help make the intermixing of components possible, using the target Class name (e.g. com.foo.bar ) as the key might help avoid collision.