org.mozilla.javascript
Interface WrapHandler
- public interface WrapHandler
Embeddings that wish to provide their own custom wrappings for Java
objects may implement this interface and call Context.setWrapHandler.
- See Also:
Context.setWrapHandler(org.mozilla.javascript.WrapHandler)
Method Summary |
java.lang.Object |
wrap(Scriptable scope,
java.lang.Object obj,
java.lang.Class staticType)
Wrap the object.
|
wrap
public java.lang.Object wrap(Scriptable scope,
java.lang.Object obj,
java.lang.Class staticType)
- Wrap the object.
The value returned must be one of
- java.lang.Boolean
- java.lang.String
- java.lang.Number
- org.mozilla.javascript.Scriptable objects
- The value returned by Context.getUndefinedValue()
- null
If null is returned, the value obj will be wrapped as if
no WrapHandler had been called.
- Parameters:
scope
- the scope of the executing scriptobj
- the object to be wrapped- Returns:
- the wrapped value.