org.mozilla.javascript
Class NativeFunction
java.lang.Object
org.mozilla.javascript.ScriptableObject
org.mozilla.javascript.IdScriptableObject
org.mozilla.javascript.BaseFunction
org.mozilla.javascript.NativeFunction
- All Implemented Interfaces:
- Callable, DebuggableObject, Function, IdFunctionCall, Scriptable, java.io.Serializable
- public abstract class NativeFunction
- extends BaseFunction
This class implements the Function native object.
See ECMA 15.3.
- Author:
- Norris Boyd
- See Also:
- Serialized Form
Methods inherited from class org.mozilla.javascript.BaseFunction |
call, construct, createObject, execIdCall, fillConstructorProperties, findInstanceIdInfo, findPrototypeId, getClassName, getClassPrototype, getFunctionName, getInstanceIdName, getInstanceIdValue, getMaxInstanceId, hasInstance, initPrototypeId, setImmunePrototypeProperty, setInstanceIdValue |
Methods inherited from class org.mozilla.javascript.IdScriptableObject |
activatePrototypeMap, addIdFunctionProperty, defaultGet, defaultPut, delete, exportAsJSClass, get, getAttributes, has, hasPrototypeMap, incompatibleCallError, initPrototypeConstructor, initPrototypeMethod, initPrototypeValue, instanceIdInfo, put, setAttributes |
Methods inherited from class org.mozilla.javascript.ScriptableObject |
associateValue, callMethod, callMethod, defineClass, defineClass, defineClass, defineFunctionProperties, defineProperty, defineProperty, defineProperty, defineProperty, delete, deleteProperty, deleteProperty, equivalentValues, get, getAllIds, getAssociatedValue, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, has, hasProperty, hasProperty, isSealed, put, putProperty, putProperty, sealObject, setAttributes, setAttributes, setAttributes, setParentScope, setPrototype |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.mozilla.javascript.Scriptable |
delete, delete, get, get, getDefaultValue, getIds, getParentScope, getPrototype, has, has, put, put, setParentScope, setPrototype |
NativeFunction
public NativeFunction()
initScriptFunction
public final void initScriptFunction(Context cx,
Scriptable scope)
getLength
public int getLength()
- Overrides:
getLength
in class BaseFunction
getArity
public int getArity()
- Overrides:
getArity
in class BaseFunction
jsGet_name
public java.lang.String jsGet_name()
- Deprecated. Use
BaseFunction.getFunctionName()
instead.
For backwards compatibility keep an old method name used by
Batik and possibly others.
getEncodedSource
public java.lang.String getEncodedSource()
- Get encoded source string.
getDebuggableView
public DebuggableScript getDebuggableView()
getLanguageVersion
protected abstract int getLanguageVersion()
getParamCount
protected abstract int getParamCount()
- Get number of declared parameters. It should be 0 for scripts.
getParamAndVarCount
protected abstract int getParamAndVarCount()
- Get number of declared parameters and variables defined through var
statements.
getParamOrVarName
protected abstract java.lang.String getParamOrVarName(int index)
- Get parameter or variable name.
If index <
getParamCount()
, then return the name of the
corresponding parameter. Otherwise returm the name of variable.