Class DVSLNodeContext

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

    class DVSLNodeContext
    extends org.apache.velocity.VelocityContext

    Context implementation that is the outer context during the transformation. Holds the node stack and also protects the 'special' context elements like 'node'

    There are special elements like 'node', which is readonly and corresponds to the current node, and 'attrib', which corresponds to a map of attributes for the current node.

    Author:
    Geir Magnusson Jr.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String ATTRIB
      Magic context entity that corresponds to a Map of attributes for the current node
      protected java.util.Map ctx  
      private static java.lang.String NODE
      Magic context entity that corresponds to the current node
      private java.util.Stack nodeStack
      Used to hold the nodes as we get invoked from within the document for applyTemplates() duties
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private DVSLNodeContext()  
        DVSLNodeContext​(org.apache.velocity.context.Context context)  
    • Field Detail

      • NODE

        private static final java.lang.String NODE
        Magic context entity that corresponds to the current node
        See Also:
        Constant Field Values
      • ATTRIB

        private static final java.lang.String ATTRIB
        Magic context entity that corresponds to a Map of attributes for the current node
        See Also:
        Constant Field Values
      • nodeStack

        private java.util.Stack nodeStack
        Used to hold the nodes as we get invoked from within the document for applyTemplates() duties
      • ctx

        protected java.util.Map ctx
    • Constructor Detail

      • DVSLNodeContext

        public DVSLNodeContext​(org.apache.velocity.context.Context context)
      • DVSLNodeContext

        private DVSLNodeContext()
    • Method Detail

      • internalGet

        public java.lang.Object internalGet​(java.lang.String key)
        retrieves value for key from internal storage
        Overrides:
        internalGet in class org.apache.velocity.VelocityContext
        Parameters:
        key - name of value to get
        Returns:
        value as object
      • internalPut

        public java.lang.Object internalPut​(java.lang.String key,
                                            java.lang.Object value)
        stores the value for key to internal storage
        Overrides:
        internalPut in class org.apache.velocity.VelocityContext
        Parameters:
        key - name of value to store
        value - value to store
        Returns:
        previous value of key as Object
      • internalContainsKey

        public boolean internalContainsKey​(java.lang.Object key)
        determines if there is a value for the given key
        Overrides:
        internalContainsKey in class org.apache.velocity.VelocityContext
        Parameters:
        key - name of value to check
        Returns:
        true if non-null value in store
      • internalGetKeys

        public java.lang.Object[] internalGetKeys()
        returns array of keys $$$ GMJ todo
        Overrides:
        internalGetKeys in class org.apache.velocity.VelocityContext
        Returns:
        keys as []
      • internalRemove

        public java.lang.Object internalRemove​(java.lang.Object key)
        remove a key/value pair from the internal storage
        Overrides:
        internalRemove in class org.apache.velocity.VelocityContext
        Parameters:
        key - name of value to remove
        Returns:
        value removed
      • clearNode

        void clearNode()
      • pushCurrentTemplateName

        public void pushCurrentTemplateName​(java.lang.String arg0)
      • popCurrentTemplateName

        public void popCurrentTemplateName()
      • getCurrentTemplateName

        public java.lang.String getCurrentTemplateName()
      • getTemplateNameStack

        public java.lang.Object[] getTemplateNameStack()
      • pushCurrentMacroName

        public void pushCurrentMacroName​(java.lang.String arg0)
      • popCurrentMacroName

        public void popCurrentMacroName()
      • getCurrentMacroName

        public java.lang.String getCurrentMacroName()
      • getCurrentMacroCallDepth

        public int getCurrentMacroCallDepth()
      • getMacroNameStack

        public java.lang.Object[] getMacroNameStack()
      • icacheGet

        public org.apache.velocity.util.introspection.IntrospectionCacheData icacheGet​(java.lang.Object arg0)
      • icachePut

        public void icachePut​(java.lang.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​(java.util.List arg0)
      • getMacroLibraries

        public java.util.List 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