org.mozilla.javascript
Class NativeBoolean
java.lang.Object
|
+--org.mozilla.javascript.ScriptableObject
|
+--org.mozilla.javascript.IdScriptable
|
+--org.mozilla.javascript.NativeBoolean
- All Implemented Interfaces:
- IdFunctionMaster, Scriptable, java.io.Serializable
- public class NativeBoolean
- extends IdScriptable
This class implements the Boolean native object.
See ECMA 15.6.
- Author:
- Norris Boyd
- See Also:
- Serialized Form
Method Summary |
java.lang.Object |
execMethod(int methodId,
IdFunction f,
Context cx,
Scriptable scope,
Scriptable thisObj,
java.lang.Object[] args)
'thisObj' will be null if invoked as constructor, in which case
instance of Scriptable should be returned. |
java.lang.String |
getClassName()
Return the name of the class.
|
java.lang.Object |
getDefaultValue(java.lang.Class typeHint)
Implements the [[DefaultValue]] internal method.
|
static void |
init(Context cx,
Scriptable scope,
boolean sealed)
|
int |
methodArity(int methodId)
Get arity or defined argument count for method with given id.
|
Methods inherited from class org.mozilla.javascript.ScriptableObject |
callMethod, defineClass, defineClass, defineFunctionProperties, defineProperty, defineProperty, defineProperty, delete, deleteProperty, deleteProperty, get, getAllIds, getAttributes, getClassPrototype, getFunctionPrototype, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, has, hasInstance, hasProperty, hasProperty, isSealed, put, putProperty, putProperty, sealObject, setAttributes, setParentScope, setPrototype |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NativeBoolean
public NativeBoolean()
- Zero-parameter constructor: just used to create Boolean.prototype
NativeBoolean
public NativeBoolean(boolean b)
init
public static void init(Context cx,
Scriptable scope,
boolean sealed)
getClassName
public java.lang.String getClassName()
- Description copied from class:
ScriptableObject
- Return the name of the class.
This is typically the same name as the constructor.
Classes extending ScriptableObject must implement this abstract
method.
- Overrides:
getClassName
in class ScriptableObject
getDefaultValue
public java.lang.Object getDefaultValue(java.lang.Class typeHint)
- Description copied from class:
ScriptableObject
- Implements the [[DefaultValue]] internal method.
Note that the toPrimitive conversion is a no-op for
every type other than Object, for which [[DefaultValue]]
is called. See ECMA 9.1.
A hint
of null means "no hint".
- Overrides:
getDefaultValue
in class ScriptableObject
- Following copied from class:
org.mozilla.javascript.ScriptableObject
- Parameters:
typeHint
- the type hint- Returns:
- the default value for the object
See ECMA 8.6.2.6.
methodArity
public int methodArity(int methodId)
- Description copied from class:
IdScriptable
- Get arity or defined argument count for method with given id.
Should return -1 if methodId is not known or can not be used
with execMethod call.
- Overrides:
methodArity
in class IdScriptable
execMethod
public java.lang.Object execMethod(int methodId,
IdFunction f,
Context cx,
Scriptable scope,
Scriptable thisObj,
java.lang.Object[] args)
throws JavaScriptException
- Description copied from class:
IdScriptable
- 'thisObj' will be null if invoked as constructor, in which case
instance of Scriptable should be returned.
- Overrides:
execMethod
in class IdScriptable