org.mozilla.javascript

Class NativeJavaConstructor

Implemented Interfaces:
Callable, DebuggableObject, Function, IdFunctionCall, Scriptable, Serializable

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:
NativeJavaMethod, NativeJavaPackage, NativeJavaClass

Field Summary

Fields inherited from class org.mozilla.javascript.ScriptableObject

DONTENUM, EMPTY, PERMANENT, READONLY

Fields inherited from interface org.mozilla.javascript.Scriptable

NOT_FOUND

Constructor Summary

NativeJavaConstructor(org.mozilla.javascript.MemberBox ctor)

Method Summary

Object
call(Context cx, Scriptable scope, Scriptable thisObj, Object[] args)
Perform the call.
String
getFunctionName()
String
toString()

Methods inherited from class org.mozilla.javascript.BaseFunction

call, construct, createObject, execIdCall, fillConstructorProperties, findInstanceIdInfo, findPrototypeId, getArity, getClassName, getClassPrototype, getFunctionName, getInstanceIdName, getInstanceIdValue, getLength, getMaxInstanceId, hasInstance, initPrototypeId, setImmunePrototypeProperty, setInstanceIdValue

Methods inherited from class org.mozilla.javascript.IdScriptableObject

activatePrototypeMap, addIdFunctionProperty, defaultGet, defaultPut, delete, execIdCall, exportAsJSClass, fillConstructorProperties, findInstanceIdInfo, findPrototypeId, get, getAttributes, getInstanceIdName, getInstanceIdValue, getMaxInstanceId, has, hasPrototypeMap, incompatibleCallError, initPrototypeConstructor, initPrototypeId, initPrototypeMethod, initPrototypeValue, instanceIdInfo, put, setAttributes, setInstanceIdValue

Methods inherited from class org.mozilla.javascript.ScriptableObject

associateValue, callMethod, callMethod, defineClass, defineClass, defineClass, defineFunctionProperties, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, equivalentValues, get, get, getAllIds, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassName, getClassPrototype, getDefaultValue, getFunctionPrototype, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, has, has, hasInstance, hasProperty, hasProperty, isSealed, put, put, putProperty, putProperty, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setParentScope, setPrototype

Constructor Details

NativeJavaConstructor

public NativeJavaConstructor(org.mozilla.javascript.MemberBox ctor)

Method Details

call

public Object call(Context cx,
                   Scriptable scope,
                   Scriptable thisObj,
                   Object[] args)
Perform the call.
Specified by:
call in interface Function
call in interface Callable
Overrides:
call in interface BaseFunction
Parameters:
cx - the current Context for this thread
scope - the scope to use to resolve properties.
thisObj - the JavaScript this object
args - the array of arguments
Returns:
the result of the call

getFunctionName

public String getFunctionName()
Overrides:
getFunctionName in interface BaseFunction

toString

public String toString()