Package freemarker.core
Class BlockScope
- java.lang.Object
-
- freemarker.core.AbstractScope
-
- freemarker.core.BaseScope
-
- freemarker.core.BlockScope
-
- All Implemented Interfaces:
Scope,TemplateHashModel,TemplateHashModelEx,TemplateModel
- Direct Known Subclasses:
LoopContext,MacroContext,MacroInvocationBodyContext
public class BlockScope extends BaseScope
-
-
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 Constructor Description BlockScope(freemarker.core.ast.TemplateElement block, Scope enclosingScope)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandefinesVariable(String name)freemarker.core.ast.TemplateElementgetBlock()TemplategetTemplate()Returns the template of the enclosing scopevoidput(String key, TemplateModel tm)Set a variable in this scope.-
Methods inherited from class freemarker.core.BaseScope
clear, get, getDirectVariableNames, isEmpty, keys, remove, size, values
-
Methods inherited from class freemarker.core.AbstractScope
getEnclosingScope, getEnvironment, resolveVariable
-
-
-
-
Constructor Detail
-
BlockScope
public BlockScope(freemarker.core.ast.TemplateElement block, Scope enclosingScope)
-
-
Method Detail
-
getTemplate
public Template getTemplate()
Description copied from class:AbstractScopeReturns the template of the enclosing scope- Specified by:
getTemplatein interfaceScope- Overrides:
getTemplatein classAbstractScope- Returns:
- the template of the enclosing scope
-
put
public void put(String key, TemplateModel tm)
Description copied from interface:ScopeSet a variable in this scope. This will typically only be used internally by the FreeMarker engine.
-
getBlock
public freemarker.core.ast.TemplateElement getBlock()
-
definesVariable
public boolean definesVariable(String name)
- Specified by:
definesVariablein interfaceScope- Overrides:
definesVariablein classBaseScope- Returns:
- whether the variable is defined in this specific scope. (It could be defined in a fallback scope and this method will return false.)
-
-