Class Scope
java.lang.Object
java.util.AbstractMap
org.apache.velocity.runtime.directive.Scope
- All Implemented Interfaces:
Map
- Direct Known Subclasses:
ForeachScope
This handles context scoping and metadata for directives.
- Version:
- $Id$
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Class to encapsulate and provide access to info about the current scope for debugging.Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionentrySet()
protected int
getDepth()
Returns the number of control arguments of this type that are stacked up.getInfo()
Returns info about the current scope for debugging purposes.Returns the parent control reference overridden by the placement of this instance in the context.Returns the user's context reference overridden by the placement of this instance in the context.private Map
Returns the topmost parent control reference, retrieved by simple recursion ongetParent()
.protected void
stop()
Allows #stop to easily trigger the proper StopCommand for this scope.Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, remove, size, toString, values
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
storage
-
replaced
-
parent
-
info
-
owner
-
-
Constructor Details
-
Scope
-
-
Method Details
-
getStorage
-
entrySet
- Specified by:
entrySet
in interfaceMap
- Specified by:
entrySet
in classAbstractMap
-
get
- Specified by:
get
in interfaceMap
- Overrides:
get
in classAbstractMap
-
put
- Specified by:
put
in interfaceMap
- Overrides:
put
in classAbstractMap
-
stop
protected void stop()Allows #stop to easily trigger the proper StopCommand for this scope. -
getDepth
protected int getDepth()Returns the number of control arguments of this type that are stacked up. This is the distance between this instance and the topmost instance, plus one. This value will never be negative or zero. -
getTopmost
Returns the topmost parent control reference, retrieved by simple recursion ongetParent()
. -
getParent
Returns the parent control reference overridden by the placement of this instance in the context. -
getReplaced
Returns the user's context reference overridden by the placement of this instance in the context. If there was none (as is hoped), then this will return null. This never returns parent controls; those are returned bygetParent()
. -
getInfo
Returns info about the current scope for debugging purposes.
-