public static class LocalContext.Reference extends Object implements Reference
This class represents a reference whose setting is local to the current
LocalContext. Setting outside of any LocalContext scope
affects the reference default value (equivalent to setDefault(java.lang.Object)).
| Constructor and Description |
|---|
Reference()
Default constructor (default referent is
null). |
Reference(Object defaultValue)
Creates a local reference having the specified default value.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
get()
Returns the local value for this reference.
|
Object |
getDefault()
Returns the default value for this reference.
|
Object |
getLocal()
Returns the local (non-inherited) value for this reference.
|
void |
set(Object value)
Sets the local value (referent) for this reference.
|
void |
setDefault(Object defaultValue)
Sets the default value for this reference.
|
String |
toString()
Returns the string representation of the current value of this
reference.
|
public Reference()
null).public Reference(Object defaultValue)
defaultValue - the default value or root value of this variable.public final Object get()
LocalContext is searched first, then
all outer LocalContext are recursively searched up to the
global root context which contains the default value.public void set(Object value)
public Object getDefault()
public Object getLocal()
null if none (value to be
inherited or not set).public void setDefault(Object defaultValue)
defaultValue - the root value.Copyright © 2005–2021 Javolution. All rights reserved.