public interface Scope
SimpleScope
Modifier and Type | Method and Description |
---|---|
boolean |
addScopeListener(ScopeListener listener)
Adds a listener to listen whether this scope is changed.
|
java.lang.Object |
getAttribute(java.lang.String name)
Returns the custom attribute associated with this object (scope).
|
java.lang.Object |
getAttribute(java.lang.String name,
boolean recurse)
Returns the custom attribute associated with this object.
|
java.util.Map<java.lang.String,java.lang.Object> |
getAttributes()
Returns all custom attributes associated with this object (scope).
|
boolean |
hasAttribute(java.lang.String name)
Returns if a custom attribute is associated with this object (scope).
|
boolean |
hasAttribute(java.lang.String name,
boolean recurse)
Returns if a custom attribute is associated with this object.
|
java.lang.Object |
removeAttribute(java.lang.String name)
Removes the attribute from the current scope if any.
|
java.lang.Object |
removeAttribute(java.lang.String name,
boolean recurse)
Removes the custom attribute associated with this scope.
|
boolean |
removeScopeListener(ScopeListener listener)
Removes a change listener from this scope.
|
java.lang.Object |
setAttribute(java.lang.String name,
java.lang.Object value)
Sets (a.k.a., associates) the value for a custom attribute with this object (scope).
|
java.lang.Object |
setAttribute(java.lang.String name,
java.lang.Object value,
boolean recurse)
Sets the custom attribute associated with this scope, or the parent
scope.
|
java.util.Map<java.lang.String,java.lang.Object> getAttributes()
java.lang.Object getAttribute(java.lang.String name)
java.lang.Object getAttribute(java.lang.String name, boolean recurse)
recurse
- whether to search its ancestor scope.
If true and the current scope doen't define the attribute,
it searches up its ancestor to see
any of them has defined the specified attribute.boolean hasAttribute(java.lang.String name)
Notice that null
is a valid value, so you can
tell if an attribute is associated by examining the return value
of getAttribute(java.lang.String)
.
boolean hasAttribute(java.lang.String name, boolean recurse)
Notice that null
is a valid value, so you can
tell if an attribute is associated by examining the return value
of getAttribute(java.lang.String)
.
recurse
- whether to search its ancestor scope.
If true and the current scope doen't define the attribute,
it searches up its ancestor to see
any of them has defined the specified attribute.java.lang.Object setAttribute(java.lang.String name, java.lang.Object value)
java.lang.Object setAttribute(java.lang.String name, java.lang.Object value, boolean recurse)
recurse
- whether to look up the parent scope for the
existence of the attribute.setAttribute(String,Object)
.java.lang.Object removeAttribute(java.lang.String name)
java.lang.Object removeAttribute(java.lang.String name, boolean recurse)
recurse
- whether to look up the parent scope for the
existence of the attribute.removeAttribute(String)
.boolean addScopeListener(ScopeListener listener)
boolean removeScopeListener(ScopeListener listener)
Copyright © 2005-2011 Potix Corporation. All Rights Reserved.