Package freemarker.core
Class TemplateNamespace
- java.lang.Object
-
- freemarker.core.AbstractScope
-
- freemarker.core.BaseScope
-
- freemarker.core.TemplateNamespace
-
- All Implemented Interfaces:
Scope,TemplateHashModel,TemplateHashModelEx,TemplateModel
- Direct Known Subclasses:
IncludedTemplateNamespace
public class TemplateNamespace extends BaseScope
Represents the namespace associated with a template
-
-
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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandefinesVariable(String name)TemplategetTemplate()Returns the template of the enclosing scopevoidput(String name, TemplateModel var)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
-
-
-
-
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 name, TemplateModel var)
Description copied from interface:ScopeSet a variable in this scope. This will typically only be used internally by the FreeMarker engine.
-
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.)
-
-