Interface Scope

    • Method Detail

      • put

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

        TemplateModel remove​(String key)
        Removes a variable in this scope. This will typically only be used by FreeMarker engine internals
      • getEnvironment

        Environment getEnvironment()
        Returns:
        the Environment object associated with this Scope.
      • getTemplate

        Template getTemplate()
        Returns:
        the Template object associated with this Scope.
      • definesVariable

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

        Scope getEnclosingScope()
        Returns:
        the fallback Scope for variable resolution
      • getDirectVariableNames

        Collection<String> getDirectVariableNames()
                                           throws TemplateModelException
        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.
        Throws:
        TemplateModelException