org.mozilla.javascript
Class NativeJavaConstructor
java.lang.Object
|
+--org.mozilla.javascript.ScriptableObject
|
+--org.mozilla.javascript.IdScriptable
|
+--org.mozilla.javascript.BaseFunction
|
+--org.mozilla.javascript.NativeFunction
|
+--org.mozilla.javascript.NativeJavaConstructor
- All Implemented Interfaces:
- Function, IdFunctionMaster, Scriptable, java.io.Serializable
- public class NativeJavaConstructor
- extends NativeFunction
- implements Function
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
, Serialized Form
Methods inherited from class org.mozilla.javascript.ScriptableObject |
callMethod, defineClass, defineClass, defineFunctionProperties, defineProperty, defineProperty, defineProperty, delete, deleteProperty, deleteProperty, get, getAllIds, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, has, hasProperty, hasProperty, isSealed, put, putProperty, putProperty, sealObject, setAttributes, setParentScope, setPrototype |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.mozilla.javascript.Scriptable |
delete, delete, get, get, getClassName, getDefaultValue, getIds, getParentScope, getPrototype, has, has, hasInstance, put, put, setParentScope, setPrototype |
NativeJavaConstructor
public NativeJavaConstructor(java.lang.reflect.Constructor ctor)
call
public java.lang.Object call(Context cx,
Scriptable scope,
Scriptable thisObj,
java.lang.Object[] args)
throws JavaScriptException
- Description copied from interface:
Function
- Call the function.
Note that the array of arguments is not guaranteed to have
length greater than 0.
- Specified by:
call
in interface Function
- Overrides:
call
in class BaseFunction
- Following copied from interface:
org.mozilla.javascript.Function
- Parameters:
cx
- the current Context for this threadscope
- 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
objectargs
- the array of arguments- Returns:
- the result of the call
- Throws:
JavaScriptException
- if an uncaught exception
occurred while executing the function
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object