code: public Scriptable wrapAsJavaObject(Context cx, Scriptable scope,
                                         Object javaObject, Class<?> staticType)
      {
          return new NativeJavaObject(scope, javaObject, staticType);
      }
docs: Wrap Java object as Scriptable instance to allow full access to its
  methods and fields from JavaScript.
  <p>
  {@link #wrap(Context, Scriptable, Object, Class)} and
  {@link #wrapNewObject(Context, Scriptable, Object)} call this method
  when they can not convert <tt>javaObject</tt> to JavaScript primitive
  value or JavaScript array.
  <p>
  Subclasses can override the method to provide custom wrappers
  for Java objects.
  @param cx the current Context for this thread
  @param scope the scope of the executing script
  @param javaObject the object to be wrapped
  @param staticType type hint. If security restrictions prevent to wrap
  object based on its class, staticType will be used instead.
  @return the wrapped value which shall not be null