Class BaseScope

    • Method Detail

      • put

        public void put​(String key,
                        TemplateModel value)
        Description copied from interface: Scope
        Set a variable in this scope. This will typically only be used internally by the FreeMarker engine.
      • remove

        public TemplateModel remove​(String key)
        Description copied from interface: Scope
        Removes a variable in this scope. This will typically only be used by FreeMarker engine internals
      • get

        public TemplateModel get​(String key)
        Description copied from interface: TemplateHashModel
        Gets a TemplateModel from the hash.
        Parameters:
        key - the name by which the TemplateModel is identified in the template.
        Returns:
        the TemplateModel referred to by the key, or null if not found.
      • definesVariable

        public boolean definesVariable​(String key)
        Returns:
        whether the variable is defined in this specific scope. (It could be defined in a fallback scope and this method will return false.)
      • clear

        public void clear()
      • getDirectVariableNames

        public Collection<String> getDirectVariableNames()
        Description copied from interface: Scope
        Returns the names of variables directly managed by this scope (i.e. it does not traverse the chain of enclosing scopes, but limits itself to this scope only).
        Returns:
        a collection of known variable names for this scope, without enclosing scopes. The returned collection should be either immutable, or it should be disconnected from the scope, so any modifications to the collection don't affect the scope.