Class 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 standard VelocityContext to add some retro compatibility (for example support for $velocityCount and $velocityHasNext).
    Since:
    12.0RC1
    Version:
    $Id: 3d5a26878c1f08291c704ee77523827814e7bb85 $
    See Also:
    Serialized Form
    • 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 - The Context 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 - The Context 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 interface org.apache.velocity.context.Context
        Overrides:
        get in class org.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 interface org.apache.velocity.context.InternalEventContext
      • getEventCartridge

        public org.apache.velocity.app.event.EventCartridge getEventCartridge()
        Specified by:
        getEventCartridge in interface org.apache.velocity.context.InternalEventContext