Class ScriptVelocityContext

  • All Implemented Interfaces:
    Serializable, Cloneable, org.apache.velocity.context.Context, org.apache.velocity.context.InternalEventContext

    public class ScriptVelocityContext
    extends org.xwiki.velocity.XWikiVelocityContext
    Maintains the current ScriptContext in sync with any modification of the VelocityContext.
    Since:
    8.3M1
    Version:
    $Id: f221a95ccfcff8340793daf80c01bca6205ea171 $
    See Also:
    Serialized Form
    • Constructor Detail

      • ScriptVelocityContext

        public ScriptVelocityContext​(org.apache.velocity.VelocityContext parent,
                                     Set<String> reservedBindings)
        Parameters:
        parent - the initial Velocity context
        reservedBindings - the binding that should not be synchronized
      • ScriptVelocityContext

        public ScriptVelocityContext​(org.apache.velocity.VelocityContext parent,
                                     boolean logDeprecated,
                                     Set<String> reservedBindings)
        Parameters:
        parent - the initial Velocity context
        logDeprecated - true if use of deprecated binding should be logged
        reservedBindings - the binding that should not be synchronized
        Since:
        12.10, 12.6.5
    • Method Detail

      • getScriptContext

        public ScriptContext getScriptContext()
        Returns:
        the current script context
      • setScriptContext

        public void setScriptContext​(ScriptContext scriptContext)
        Parameters:
        scriptContext - the current script context
      • internalPut

        public Object internalPut​(String key,
                                  Object value)
        Overrides:
        internalPut in class org.apache.velocity.VelocityContext
      • internalRemove

        public Object internalRemove​(String key)
        Overrides:
        internalRemove in class org.apache.velocity.VelocityContext
      • 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