Interface IJavascriptWrapper

All Known Implementing Classes:
CoreJavaScriptWrapper

public interface IJavascriptWrapper
Interface used to wrap a java object into javascript object.
  • Method Summary

    Modifier and Type
    Method
    Description
    wrap(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable scope, Object javaObject, Class staticType)
    wrap an java object into javascript object.
  • Method Details

    • wrap

      Object wrap(org.mozilla.javascript.Context cx, org.mozilla.javascript.Scriptable scope, Object javaObject, Class staticType)
      wrap an java object into javascript object. There is a list of warppers in BIRTWrapFactory, the BIRTWrapFactory will call those wrappers one by one to try to wrap the object. If the return object is different with the orginal one, it will terminate the loop.
      Parameters:
      cx - context used to execute the wrap.
      scope - scope used to execute the wrap.
      javaObject - orignal java object
      staticType - hint used to wrap this object
      Returns:
      return wrapped object if this interface support the class, return the orignal directly if it doesn't support such a object.