Class NativeJavaConstructor

All Implemented Interfaces:
Serializable, Callable, ConstProperties, Constructable, DebuggableObject, Function, IdFunctionCall, Scriptable, SymbolScriptable

public class NativeJavaConstructor extends BaseFunction
This class reflects a single Java constructor into the JavaScript environment. It satisfies a request for an overloaded constructor, as introduced in LiveConnect 3. All NativeJavaConstructors behave as JSRef `bound' methods, in that they always construct the same NativeJavaClass regardless of any reparenting that may occur.
Author:
Frank Mitchell
See Also:
  • Constructor Details

    • NativeJavaConstructor

      public NativeJavaConstructor(org.mozilla.javascript.MemberBox ctor)
  • Method Details

    • call

      public Object call(Context cx, Scriptable scope, Scriptable thisObj, Object[] args)
      Description copied from class: BaseFunction
      Should be overridden.
      Specified by:
      call in interface Callable
      Specified by:
      call in interface Function
      Overrides:
      call in class BaseFunction
      Parameters:
      cx - the current Context for this thread
      scope - the scope to execute the function relative to. This is set to the value returned by getParentScope() except when the function is called from a closure.
      thisObj - the JavaScript this object
      args - the array of arguments
      Returns:
      the result of the call
    • getFunctionName

      public String getFunctionName()
      Overrides:
      getFunctionName in class BaseFunction
    • toString

      public String toString()
      Overrides:
      toString in class Object