bsh
Class ExternalNameSpace
- java.io.Serializable, BshClassManager.Listener, NameSource
public class ExternalNameSpace
A namespace which maintains an external map of values held in variables in
its scope. This mechanism provides a standard collections based interface
to the namespace as well as a convenient way to export and view values of
the namespace without the ordinary BeanShell wrappers.
Variables are maintained internally in the normal fashion to support
meta-information (such as variable type and visibility modifiers), but
exported and imported in a synchronized way. Variables are exported each
time they are written by BeanShell. Imported variables from the map appear
in the BeanShell namespace as untyped variables with no modifiers and
shadow any previously defined variables in the scope.
Note: this class is inherentely dependent on Java 1.2, however it is not
used directly by the core as other than type NameSpace, so no dependency is
introduced.
void | clear() - Clear all variables, methods, and imports from this namespace and clear
all values from the external map (via Map clear()).
|
protected void | getAllNamesAux(Vector vec)
|
Variable[] | getDeclaredVariables()
|
Map | getMap() - Get the map view of this namespace.
|
BshMethod | getMethod(String name, Class[] sig, boolean declaredOnly)
|
protected Variable | getVariableImpl(String name, boolean recurse)
|
String[] | getVariableNames()
|
protected void | putExternalMap(String name, Object value) - Place an unwrapped value in the external map.
|
void | setMap(Map map) - Set the external Map which to which this namespace synchronizes.
|
void | setMethod(String name, BshMethod method)
|
void | setTypedVariable(String name, Class type, Object value, Modifiers modifiers)
|
void | unsetVariable(String name)
|
addNameSourceListener , classLoaderChanged , clear , doSuperImport , get , getAllNames , getAllNamesAux , getClass , getClassManager , getCommand , getDeclaredVariables , getGlobal , getImportedMethod , getImportedVar , getInvocationLine , getInvocationText , getMethod , getMethod , getMethodNames , getMethods , getName , getParent , getSuper , getVariable , getVariable , getVariableImpl , getVariableNames , identifierToClass , importClass , importCommands , importObject , importPackage , importStatic , invokeMethod , invokeMethod , loadDefaultImports , nameSpaceChanged , prune , setMethod , setName , setParent , setTypedVariable , setTypedVariable , setVariable , toString , unsetVariable , unwrapVariable |
ExternalNameSpace
public ExternalNameSpace()
ExternalNameSpace
public ExternalNameSpace(NameSpace parent,
String name,
Map externalMap)
clear
public void clear()
Clear all variables, methods, and imports from this namespace and clear
all values from the external map (via Map clear()).
- clear in interface NameSpace
getMap
public Map getMap()
Get the map view of this namespace.
putExternalMap
protected void putExternalMap(String name,
Object value)
Place an unwrapped value in the external map.
BeanShell primitive types are represented by their object wrappers, so
it is not possible to differentiate between wrapper types and primitive
types via the external Map.
setMap
public void setMap(Map map)
Set the external Map which to which this namespace synchronizes.
The previous external map is detached from this namespace. Previous
map values are retained in the external map, but are removed from the
BeanShell namespace.
B) 2000-2005 pat@pat.net :-)