public class ObjectWrapperManager
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NO_WRAP
Factory name to use for classes that should not be wrapped.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
dispose()
Remove the ObjectWrapperManager instance from the Map once the
script evaluation has completed.
|
static ObjectWrapperManager |
getInstance()
Get a reference to the ObjectWrapperManager which is
created by the current script evaluating thread.
|
java.lang.Object |
lookupItem(java.lang.String name)
Gets the origional Object with the given name.
|
void |
remove(java.lang.String key)
Remove the Object associated with
key from the lookup map. |
void |
storeItem(java.lang.Object obj,
ObjectWrapper wrapper)
This method generates a unique key for the wrapper and sets the name via
the
ObjectWrapper.setKey(String key) method, then inserts
obj into the lookup map maintained by ObjectWrapperManager so we can get
at the origional object later. |
java.lang.Object |
wrap(java.lang.String name,
java.lang.Object obj,
java.lang.String lang,
java.lang.Object param)
Wraps obj with the correct type of Wrapper based on the configuration.
|
java.lang.Object |
wrapInternalObject(java.lang.String name,
java.lang.Object obj,
java.lang.String lang,
java.lang.Object param)
Wraps obj with the correct type of Wrapper based on the configuration.
If the wrapper to use for obj is com.ibm.itim.script.wrappers.NO_WRAP then obj will be returned and not wrapped or inserted into the lookup map. |
public static final java.lang.String NO_WRAP
public static ObjectWrapperManager getInstance()
public java.lang.Object wrap(java.lang.String name,
java.lang.Object obj,
java.lang.String lang,
java.lang.Object param)
name - Name that can be used to look this bean up using the
ScriptEvaluator. This is typically the bean name, and can be
null. If name is null, then a unique id will be automatically
assigned.obj - The Object to wrap.lang - The scripting language we are using.param - Some wrapper classes need parameters to correctly wrap
objects. param is how this information is passed.public void remove(java.lang.String key)
key from the lookup map.
This method should only be called by the dispose() method
of ObjectWrapper classes.
Though the references to this method still exist, this method is not used
anymore by internal script engine implementation of ITIM.key - The key (or name) used to lookup objects in
ObjectWrapperManager. Since this method is only supposed to be
called by ObjectWrapper classes, key can be
gotten from the getKey() method.public static void dispose()
public java.lang.Object lookupItem(java.lang.String name)
name - The name of the Object used when wrapping the Object.public void storeItem(java.lang.Object obj,
ObjectWrapper wrapper)
ObjectWrapper.setKey(String key) method, then inserts
obj into the lookup map maintained by ObjectWrapperManager so we can get
at the origional object later.
This method exists so that items constructed from the script environment,
in their wrappers, can still be accessed outside of the scripting
environment.obj - The object that is wrapped.wrapper - The wrapped version of obj.public java.lang.Object wrapInternalObject(java.lang.String name,
java.lang.Object obj,
java.lang.String lang,
java.lang.Object param)
name - Name that can be used to look this bean up using the
ScriptEvaluator. This is typically the bean name, and can be
null. If name is null, then a unique id will be automatically
assigned.obj - The Object to wrap.lang - The scripting language we are using.param - Some wrapper classes need parameters to correctly wrap
objects. param is how this information is passed.