Class Scope
- Direct Known Subclasses:
ForeachScope
This handles context scoping and metadata for directives.
- Version:
- $Id$
- Author:
- Nathan Bubna
-
Nested Class Summary
Modifier 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,
V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionentrySet()
getterprotected 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.Returns the topmost parent control reference, retrieved by simple recursion ongetParent()
.setterConvenience method to call put(key,val) in a template without worrying about what is returned/rendered by the call.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
-
owner
-
-
Constructor Details
-
Scope
- Parameters:
owner
-previous
-
-
-
Method Details
-
entrySet
-
get
getter -
put
setter -
set
Convenience method to call put(key,val) in a template without worrying about what is returned/rendered by the call. This should ALWAYS return an empty string.- Parameters:
key
-value
-- Returns:
- empty string
-
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.- Returns:
- depth
-
getTopmost
Returns the topmost parent control reference, retrieved by simple recursion ongetParent()
.- Returns:
- top-most scope
-
getParent
Returns the parent control reference overridden by the placement of this instance in the context.- Returns:
- parent scope
-
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()
.- Returns:
- replaced reference value, or null
-
getInfo
Returns info about the current scope for debugging purposes.- Returns:
- template debugging infos
-