Package com.xpn.xwiki.render
Class DefaultVelocityManager
- java.lang.Object
-
- com.xpn.xwiki.render.DefaultVelocityManager
-
- All Implemented Interfaces:
org.xwiki.component.phase.Initializable
,org.xwiki.velocity.VelocityManager
@Component @Singleton public class DefaultVelocityManager extends Object implements org.xwiki.velocity.VelocityManager, org.xwiki.component.phase.Initializable
Note: This class should be moved to the Velocity module. However this is not possible right now since we need to populate the Velocity Context with XWiki objects that are located in the Core (such as the XWiki object for example) and since the Core needs to call the Velocity module this would cause a circular dependency.- Since:
- 1.5M1
- Version:
- $Id: b9a57cac3768c15065fca4c49e54ff913e596cbc $
-
-
Constructor Summary
Constructors Constructor Description DefaultVelocityManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
evaluate(Writer out, String templateName, Reader source)
org.apache.velocity.VelocityContext
getCurrentVelocityContext()
org.apache.velocity.VelocityContext
getVelocityContext()
org.xwiki.velocity.VelocityEngine
getVelocityEngine()
void
initialize()
-
-
-
Method Detail
-
initialize
public void initialize() throws org.xwiki.component.phase.InitializationException
- Specified by:
initialize
in interfaceorg.xwiki.component.phase.Initializable
- Throws:
org.xwiki.component.phase.InitializationException
-
getVelocityContext
public org.apache.velocity.VelocityContext getVelocityContext()
- Specified by:
getVelocityContext
in interfaceorg.xwiki.velocity.VelocityManager
-
getCurrentVelocityContext
public org.apache.velocity.VelocityContext getCurrentVelocityContext()
- Specified by:
getCurrentVelocityContext
in interfaceorg.xwiki.velocity.VelocityManager
-
getVelocityEngine
public org.xwiki.velocity.VelocityEngine getVelocityEngine() throws org.xwiki.velocity.XWikiVelocityException
- Specified by:
getVelocityEngine
in interfaceorg.xwiki.velocity.VelocityManager
- Returns:
- the Velocity Engine corresponding to the current execution context. More specifically returns the Velocity Engine for the current skin since each skin has its own Velocity Engine so that each skin can have global velocimacros defined
- Throws:
org.xwiki.velocity.XWikiVelocityException
- in case of an error while creating a Velocity Engine
-
-