|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface for internal runtime services that are needed by the various components w/in Velocity. This was taken from the old Runtime singleton, and anything not necessary was removed. Currently implemented by RuntimeInstance.
Method Summary | |
---|---|
void |
addProperty(java.lang.String key,
java.lang.Object value)
Add a property to the configuration. |
boolean |
addVelocimacro(java.lang.String name,
java.lang.String macro,
java.lang.String[] argArray,
java.lang.String sourceTemplate)
Adds a new Velocimacro. |
void |
clearProperty(java.lang.String key)
Clear the values pertaining to a particular property. |
boolean |
dumpVMNamespace(java.lang.String namespace)
tells the vmFactory to dump the specified namespace. |
java.lang.Object |
getApplicationAttribute(java.lang.Object key)
Return the specified applcation attribute. |
boolean |
getBoolean(java.lang.String key,
boolean def)
Boolean property accessor method to hide the configuration implementation. |
org.apache.commons.collections.ExtendedProperties |
getConfiguration()
Return the velocity runtime configuration object. |
ContentResource |
getContent(java.lang.String name)
Returns a static content resource from the resource manager. |
ContentResource |
getContent(java.lang.String name,
java.lang.String encoding)
Returns a static content resource from the resource manager. |
int |
getInt(java.lang.String key)
Int property accessor method to hide the configuration implementation. |
int |
getInt(java.lang.String key,
int defaultValue)
Int property accessor method to hide the configuration implementation. |
Introspector |
getIntrospector()
Returns the configured method introspection/reflection implemenation. |
java.lang.String |
getLoaderNameForResource(java.lang.String resourceName)
Determines is a template exists, and returns name of the loader that provides it. |
java.lang.Object |
getProperty(java.lang.String key)
Allows an external caller to get a property. |
java.lang.String |
getString(java.lang.String key)
String property accessor method to hide the configuration implementation |
java.lang.String |
getString(java.lang.String key,
java.lang.String defaultValue)
String property accessor method with default to hide the configuration implementation. |
Template |
getTemplate(java.lang.String name)
Returns a Template from the resource manager. |
Template |
getTemplate(java.lang.String name,
java.lang.String encoding)
Returns a Template from the resource manager |
Uberspect |
getUberspect()
Returns the configured class introspection/reflection implemenation. |
Directive |
getVelocimacro(java.lang.String vmName,
java.lang.String templateName)
Returns the appropriate VelocimacroProxy object if strVMname is a valid current Velocimacro. |
void |
init()
|
void |
init(java.util.Properties p)
Initialize the Velocity Runtime with a Properties object. |
void |
init(java.lang.String configurationFile)
Initialize the Velocity Runtime with the name of ExtendedProperties object. |
boolean |
isVelocimacro(java.lang.String vmName,
java.lang.String templateName)
Checks to see if a VM exists |
SimpleNode |
parse(java.io.Reader reader,
java.lang.String templateName)
Parse the input and return the root of AST node structure. |
SimpleNode |
parse(java.io.Reader reader,
java.lang.String templateName,
boolean dumpNamespace)
Parse the input and return the root of the AST node structure. |
void |
setConfiguration(org.apache.commons.collections.ExtendedProperties configuration)
Allow an external system to set an ExtendedProperties object to use. |
void |
setProperty(java.lang.String key,
java.lang.Object value)
Allows an external system to set a property in the Velocity Runtime. |
Methods inherited from interface org.apache.velocity.runtime.RuntimeLogger |
---|
debug, error, info, warn |
Method Detail |
public void init() throws java.lang.Exception
java.lang.Exception
public void setProperty(java.lang.String key, java.lang.Object value)
public void setConfiguration(org.apache.commons.collections.ExtendedProperties configuration)
public void addProperty(java.lang.String key, java.lang.Object value)
public void clearProperty(java.lang.String key)
public java.lang.Object getProperty(java.lang.String key)
key
- property to returnpublic void init(java.util.Properties p) throws java.lang.Exception
java.lang.Exception
public void init(java.lang.String configurationFile) throws java.lang.Exception
java.lang.Exception
public SimpleNode parse(java.io.Reader reader, java.lang.String templateName) throws ParseException
ParseException
public SimpleNode parse(java.io.Reader reader, java.lang.String templateName, boolean dumpNamespace) throws ParseException
dumpNamespace
- flag to dump the Velocimacro namespace for this template
ParseException
public Template getTemplate(java.lang.String name) throws ResourceNotFoundException, ParseErrorException, java.lang.Exception
Template
from the resource manager.
This method assumes that the character encoding of the
template is set by the input.encoding
property. The default is "ISO-8859-1"
name
- The file name of the desired template.
ResourceNotFoundException
- if template not found
from any available source.
ParseErrorException
- if template cannot be parsed due
to syntax (or other) error.
java.lang.Exception
- if an error occurs in template initializationpublic Template getTemplate(java.lang.String name, java.lang.String encoding) throws ResourceNotFoundException, ParseErrorException, java.lang.Exception
Template
from the resource manager
name
- The name of the desired template.encoding
- Character encoding of the template
ResourceNotFoundException
- if template not found
from any available source.
ParseErrorException
- if template cannot be parsed due
to syntax (or other) error.
java.lang.Exception
- if an error occurs in template initializationpublic ContentResource getContent(java.lang.String name) throws ResourceNotFoundException, ParseErrorException, java.lang.Exception
name
- Name of content resource to get
ResourceNotFoundException
- if template not found
from any available source.
ParseErrorException
java.lang.Exception
public ContentResource getContent(java.lang.String name, java.lang.String encoding) throws ResourceNotFoundException, ParseErrorException, java.lang.Exception
name
- Name of content resource to getencoding
- Character encoding to use
ResourceNotFoundException
- if template not found
from any available source.
ParseErrorException
java.lang.Exception
public java.lang.String getLoaderNameForResource(java.lang.String resourceName)
resourceName
- Name of template or content resource
public java.lang.String getString(java.lang.String key, java.lang.String defaultValue)
public Directive getVelocimacro(java.lang.String vmName, java.lang.String templateName)
public boolean addVelocimacro(java.lang.String name, java.lang.String macro, java.lang.String[] argArray, java.lang.String sourceTemplate)
public boolean isVelocimacro(java.lang.String vmName, java.lang.String templateName)
public boolean dumpVMNamespace(java.lang.String namespace)
public java.lang.String getString(java.lang.String key)
key
- property key
public int getInt(java.lang.String key)
public int getInt(java.lang.String key, int defaultValue)
key
- property key
public boolean getBoolean(java.lang.String key, boolean def)
public org.apache.commons.collections.ExtendedProperties getConfiguration()
public java.lang.Object getApplicationAttribute(java.lang.Object key)
key
- The name of the attribute to retrieve.public Uberspect getUberspect()
public Introspector getIntrospector()
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |