public class SecurePackage extends Package
pnuts -J-Djava.security.manager "-J-Dpnuts.package.factory=pnuts.security.SecurePackage\$Factory" scripts
autoloadTable, exportedSymbols, exports, globalPackage, initialized, name, packages, parent, providedModuleNames, requiredModuleNames, root, usedAsModule
Constructor and Description |
---|
SecurePackage(java.lang.String name,
Package parent) |
Modifier and Type | Method and Description |
---|---|
protected void |
addPackage(Package pkg,
Context context) |
java.util.Enumeration |
bindings()
Returns an enumeration of the NamedValues in the symbol table.
|
void |
clear()
Deletes all name-value bindings.
|
void |
clear(java.lang.String symbol,
Context context)
Deletes a symbol from the package.
|
java.lang.Object |
get(java.lang.String interned)
Gets the value of a variable.
|
java.util.Enumeration |
keys()
Returns an enumeration of the keys in the symbol table.
|
NamedValue |
lookup(java.lang.String interned)
Looks for a name-value binding in the symbol table chain.
|
protected void |
removePackage(Package pkg,
Context context) |
void |
set(java.lang.String interned,
java.lang.Object value)
Defines a name-value binding in the symbol table.
|
void |
set(java.lang.String symbol,
java.lang.Object obj,
Context context)
Set a value of a symbol in the package.
|
void |
setConstant(java.lang.String interned,
java.lang.Object value)
Defines a constant in the symbol table.
|
int |
size() |
java.util.Enumeration |
values()
Returns an enumeration of the values in the symbol table.
|
asMap, autoload, autoload, clone, defined, elements, export, find, find, get, getGlobalPackage, getName, getPackage, getPackage, getParent, init, initializeModule, lookup, lookupRecursively, newInstance, remove, remove, toString, wrap
public SecurePackage(java.lang.String name, Package parent)
protected void addPackage(Package pkg, Context context)
addPackage
in class Package
public void set(java.lang.String symbol, java.lang.Object obj, Context context)
Package
public void clear(java.lang.String symbol, Context context)
Package
protected void removePackage(Package pkg, Context context)
removePackage
in class Package
public java.lang.Object get(java.lang.String interned)
interned
- the name of the variable, which must be intern'dpublic NamedValue lookup(java.lang.String interned)
interned
- the name of the variable, which must be intern'dpublic void set(java.lang.String interned, java.lang.Object value)
interned
- the name of the variable, which must be intern'dvalue
- the new valuejava.lang.IllegalStateException
- thrown when the specified symbol has been defined as a
constant.public void setConstant(java.lang.String interned, java.lang.Object value)
interned
- the name of the variable, which must be intern'dvalue
- the constant valuejava.lang.IllegalStateException
- thrown when the specified symbol has been defined as a
constantpublic void clear()
public int size()
public java.util.Enumeration bindings()
NamedValue
public java.util.Enumeration keys()
public java.util.Enumeration values()