Method | Description | |
---|---|---|
AddProperty ( String key, Object value ) : void |
Add a Velocity Runtime property.
|
|
ClearProperty ( String key ) : void |
Clear a Velocity Runtime property.
|
|
Debug ( Object message ) : void |
Log a debug message.
|
|
Error ( Object message ) : void |
Log an error message.
|
|
Evaluate ( IContext context, |
renders the input string using the context into the output writer. To be used when a template is dynamically constructed, or want to use Velocity as a token replacer.
|
|
Evaluate ( IContext context, |
Renders the input reader using the context into the output writer. To be used when a template is dynamically constructed, or want to use Velocity as a token replacer.
|
|
GetProperty ( String key ) : Object |
Get a Velocity Runtime property.
|
|
GetTemplate ( String name ) : Template |
Returns a
|
|
GetTemplate ( String name, String encoding ) : Template |
Returns a
|
|
Info ( Object message ) : void |
Log an info message.
|
|
Init ( ) : void |
initialize the Velocity runtime engine, using the default properties of the Velocity distribution
|
|
Init ( |
initialize the Velocity runtime engine, using default properties plus the properties in the passed in java.util.Properties object
|
|
Init ( String propsFilename ) : void |
initialize the Velocity runtime engine, using default properties plus the properties in the properties file passed in as the arg
|
|
InvokeVelocimacro ( String vmName, String logTag, String parameters, IContext context, |
Invokes a currently registered Velocimacro with the parameters provided and places the rendered stream into the writer. Note : currently only accepts args to the VM if they are in the context.
|
|
MergeTemplate ( String templateName, String encoding, IContext context, |
merges a template and puts the rendered stream into the writer
|
|
SetApplicationAttribute ( Object key, Object value ) : void |
Set the an ApplicationAttribute, which is an Object set by the application which is 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 loaders and loggers. 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.
|
|
SetExtendedProperties ( |
Set an entire configuration at once. This is useful in cases where the parent application uses the ExtendedProperties class and the velocity configuration is a subset of the parent application's configuration.
|
|
SetProperty ( String key, Object value ) : void |
Set a Velocity Runtime property.
|
|
TemplateExists ( String templateName ) : bool |
Determines if a template is accessible via the currently configured resource loaders.
|
|
VelocityEngine ( ) : System |
Init-less CTOR
|
|
VelocityEngine ( |
CTOR that invokes an init(String), initializing the engine using the Properties specified
|
|
VelocityEngine ( String propsFilename ) : System |
CTOR that invokes an init(String), initializing the engine using the properties file specified
|
|
Warn ( Object message ) : void |
Log a warning message.
|
Method | Description | |
---|---|---|
Evaluate ( IContext context, |
||
MergeTemplate ( String templateName, IContext context, |
public AddProperty ( String key, Object value ) : void | ||
key | String | |
value | Object | |
return | void |
public ClearProperty ( String key ) : void | ||
key | String | key of property to clear |
return | void |
public Debug ( Object message ) : void | ||
message | Object | message to log |
return | void |
public Error ( Object message ) : void | ||
message | Object | message to log |
return | void |
public Evaluate ( IContext context, |
||
context | IContext | context to use in rendering input string |
writer | Writer in which to render the output | |
logTag | String | string to be used as the template name for log messages in case of error |
inString | String | input string containing the VTL to be rendered |
return | bool |
public Evaluate ( IContext context, |
||
context | IContext | context to use in rendering input string |
writer | Writer in which to render the output | |
logTag | String | string to be used as the template name for log messages in case of error |
reader | TextReader | Reader containing the VTL to be rendered |
return | bool |
public GetProperty ( String key ) : Object | ||
key | String | property to retrieve |
return | Object |
public GetTemplate ( String name ) : Template | ||
name | String | The file name of the desired template. |
return | Template |
public GetTemplate ( String name, String encoding ) : Template | ||
name | String | The file name of the desired template. |
encoding | String | The character encoding to use for the template. |
return | Template |
public Info ( Object message ) : void | ||
message | Object | message to log |
return | void |
public Init ( |
||
p | Properties object containing initialization properties | |
return | void |
public Init ( String propsFilename ) : void | ||
propsFilename | String | file containing properties to use to initialize /// the Velocity runtime |
return | void |
public InvokeVelocimacro ( String vmName, String logTag, String parameters, IContext context, |
||
vmName | String | name of Velocimacro to call |
logTag | String | string to be used for template name in case of error |
parameters | String | args used to invoke Velocimacro. In context key format : /// eg "foo","bar" (rather than "$foo","$bar") /// |
context | IContext | Context object containing data/objects used for rendering. |
writer | Writer for output stream | |
return | bool |
public MergeTemplate ( String templateName, String encoding, IContext context, |
||
templateName | String | name of template to be used in merge |
encoding | String | encoding used in template |
context | IContext | filled context to be used in merge |
writer | writer to write template into | |
return | bool |
public SetApplicationAttribute ( Object key, Object value ) : void | ||
key | Object | object 'name' under which the object is stored |
value | Object | object to store under this key |
return | void |
public SetExtendedProperties ( |
||
value | ||
return | void |
public SetProperty ( String key, Object value ) : void | ||
key | String | |
value | Object | |
return | void |
public TemplateExists ( String templateName ) : bool | ||
templateName | String | name of the template to search for /// |
return | bool |
public VelocityEngine ( |
||
p | name of properties to init with | |
return | System |
public VelocityEngine ( String propsFilename ) : System | ||
propsFilename | String | name of properties file to init with |
return | System |
public Warn ( Object message ) : void | ||
message | Object | message to log |
return | void |