Package org.xwiki.velocity
Class XWikiVelocityContext
- java.lang.Object
-
- org.apache.velocity.context.AbstractContext
-
- org.apache.velocity.VelocityContext
-
- org.xwiki.velocity.XWikiVelocityContext
-
- All Implemented Interfaces:
Serializable
,Cloneable
,org.apache.velocity.context.Context
,org.apache.velocity.context.InternalEventContext
public class XWikiVelocityContext extends org.apache.velocity.VelocityContext
Extends the standardVelocityContext
to add some retro compatibility (for example support for $velocityCount and $velocityHasNext).- Since:
- 12.0RC1
- Version:
- $Id: 3d5a26878c1f08291c704ee77523827814e7bb85 $
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description XWikiVelocityContext()
Creates a new instance (with no inner context).XWikiVelocityContext(org.apache.velocity.context.Context innerContext)
Chaining constructor, used when you want to wrap a context in another.XWikiVelocityContext(org.apache.velocity.context.Context innerContext, boolean logDeprecated)
Chaining constructor, used when you want to wrap a context in another.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.velocity.app.event.EventCartridge
attachEventCartridge(org.apache.velocity.app.event.EventCartridge arg0)
Object
get(String key)
int
getCurrentMacroCallDepth()
String
getCurrentMacroName()
org.apache.velocity.runtime.resource.Resource
getCurrentResource()
String
getCurrentTemplateName()
org.apache.velocity.app.event.EventCartridge
getEventCartridge()
List<org.apache.velocity.Template>
getMacroLibraries()
String[]
getMacroNameStack()
String[]
getTemplateNameStack()
org.apache.velocity.util.introspection.IntrospectionCacheData
icacheGet(Object arg0)
void
icachePut(Object arg0, org.apache.velocity.util.introspection.IntrospectionCacheData arg1)
void
popCurrentMacroName()
void
popCurrentTemplateName()
void
pushCurrentMacroName(String arg0)
void
pushCurrentTemplateName(String arg0)
void
setCurrentResource(org.apache.velocity.runtime.resource.Resource arg0)
void
setMacroLibraries(List<org.apache.velocity.Template> arg0)
-
Methods inherited from class org.apache.velocity.VelocityContext
clone, internalContainsKey, internalGet, internalGetKeys, internalPut, internalRemove
-
-
-
-
Constructor Detail
-
XWikiVelocityContext
public XWikiVelocityContext()
Creates a new instance (with no inner context).
-
XWikiVelocityContext
public XWikiVelocityContext(org.apache.velocity.context.Context innerContext)
Chaining constructor, used when you want to wrap a context in another. The inner context will be 'read only' - put() calls to the wrapping context will only effect the outermost context- Parameters:
innerContext
- TheContext
implementation to wrap.
-
XWikiVelocityContext
public XWikiVelocityContext(org.apache.velocity.context.Context innerContext, boolean logDeprecated)
Chaining constructor, used when you want to wrap a context in another. The inner context will be 'read only' - put() calls to the wrapping context will only effect the outermost context- Parameters:
innerContext
- TheContext
implementation to wrap.logDeprecated
- true if use of deprecated binding should be logged- Since:
- 12.4
-
-
Method Detail
-
get
public Object get(String key)
- Specified by:
get
in interfaceorg.apache.velocity.context.Context
- Overrides:
get
in classorg.apache.velocity.context.AbstractContext
-
pushCurrentTemplateName
public void pushCurrentTemplateName(String arg0)
-
popCurrentTemplateName
public void popCurrentTemplateName()
-
getCurrentTemplateName
public String getCurrentTemplateName()
-
getTemplateNameStack
public String[] getTemplateNameStack()
-
pushCurrentMacroName
public void pushCurrentMacroName(String arg0)
-
popCurrentMacroName
public void popCurrentMacroName()
-
getCurrentMacroName
public String getCurrentMacroName()
-
getCurrentMacroCallDepth
public int getCurrentMacroCallDepth()
-
getMacroNameStack
public String[] getMacroNameStack()
-
icacheGet
public org.apache.velocity.util.introspection.IntrospectionCacheData icacheGet(Object arg0)
-
icachePut
public void icachePut(Object arg0, org.apache.velocity.util.introspection.IntrospectionCacheData arg1)
-
setCurrentResource
public void setCurrentResource(org.apache.velocity.runtime.resource.Resource arg0)
-
getCurrentResource
public org.apache.velocity.runtime.resource.Resource getCurrentResource()
-
setMacroLibraries
public void setMacroLibraries(List<org.apache.velocity.Template> arg0)
-
getMacroLibraries
public List<org.apache.velocity.Template> getMacroLibraries()
-
attachEventCartridge
public org.apache.velocity.app.event.EventCartridge attachEventCartridge(org.apache.velocity.app.event.EventCartridge arg0)
- Specified by:
attachEventCartridge
in interfaceorg.apache.velocity.context.InternalEventContext
-
getEventCartridge
public org.apache.velocity.app.event.EventCartridge getEventCartridge()
- Specified by:
getEventCartridge
in interfaceorg.apache.velocity.context.InternalEventContext
-
-