|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
@Role public interface VelocityFactory
Allows creating different Velocity engine instances. This is useful when you need to have different Velocity engines running in the same JVM but with different configurations. Since global templates in Velocity are part of the configuration the only solution to use different global templates is to use different Velocity engines. As an example we need this in XWiki since we want to allow each Skin to provide its own global macros.
| Method Summary | |
|---|---|
VelocityEngine |
createVelocityEngine(String key,
Properties properties)
Creates a new Velocity engine instance, which will be cached using a specific key for later reuse. |
VelocityEngine |
getVelocityEngine(String key)
Retrieves from the cache the Velocity engine corresponding to a specific key, if such an engine was already created. |
boolean |
hasVelocityEngine(String key)
Check if an engine was already created for a certain key. |
| Method Detail |
|---|
boolean hasVelocityEngine(String key)
key - the key under which the Velocity engine has been saved in cache. This is the key used when the
Velocity engine was created using createVelocityEngine(String, java.util.Properties)
true if there is a cached Velocity Engine matching the passed key, false
otherwise.VelocityEngine getVelocityEngine(String key)
key - the key under which the Velocity engine has been saved in cache. This is the key used when the
Velocity engine was created using createVelocityEngine(String, java.util.Properties)
null if not found
VelocityEngine createVelocityEngine(String key,
Properties properties)
throws XWikiVelocityException
key - the key used to cache the Velocity engine instance to returnproperties - the list of properties that will override the default properties when creating the engine. For
example it's possible to define a list of global velocimacros by passing the
RuntimeConstants.VM_LIBRARY property key.
XWikiVelocityException - if the Velocity Engine cannot be initialized for some reason
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||