Overview | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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.

Method Detail

### 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 script
    `obj` - the object to be wrapped
  Returns:
    the wrapped value.

Overview | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD