Package freemarker.core
Class AbstractScope
java.lang.Object
freemarker.core.AbstractScope
- All Implemented Interfaces:
Scope,TemplateHashModel,TemplateHashModelEx,TemplateModel
- Direct Known Subclasses:
BaseScope
An abstract scope with no variable storage mechanism of its own; only
provides enclosing scope and operations related to enclosing scope.
-
Nested Class Summary
Nested classes/interfaces inherited from interface freemarker.template.TemplateModel
TemplateModel.InvalidExpressionModel, TemplateModel.JavaNull -
Field Summary
Fields inherited from interface freemarker.template.TemplateModel
INVALID_EXPRESSION, JAVA_NULL, NOTHING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal ScopeReturns the Environment of the enclosing scopeReturns the template of the enclosing scopebooleanisEmpty()final TemplateModelresolveVariable(String key) Evaluates the variable of this name in this scope, falling back to the enclosing Scope if it is not defined in this one.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface freemarker.core.Scope
definesVariable, getDirectVariableNames, put, removeMethods inherited from interface freemarker.template.TemplateHashModel
getMethods inherited from interface freemarker.template.TemplateHashModelEx
keys, size, values
-
Constructor Details
-
AbstractScope
-
-
Method Details
-
getEnclosingScope
- Specified by:
getEnclosingScopein interfaceScope- Returns:
- the fallback Scope for variable resolution
-
getTemplate
Returns the template of the enclosing scope- Specified by:
getTemplatein interfaceScope- Returns:
- the template of the enclosing scope
-
getEnvironment
Returns the Environment of the enclosing scope- Specified by:
getEnvironmentin interfaceScope- Returns:
- the Environment of the enclosing scope
-
resolveVariable
Description copied from interface:ScopeEvaluates the variable of this name in this scope, falling back to the enclosing Scope if it is not defined in this one.- Specified by:
resolveVariablein interfaceScope- Throws:
TemplateModelException
-
isEmpty
- Specified by:
isEmptyin interfaceTemplateHashModel- Throws:
TemplateModelException
-