public abstract class AbstractJSObject extends Object implements JSObject
Constructor and Description |
---|
AbstractJSObject() |
Modifier and Type | Method and Description |
---|---|
Object |
call(Object thiz,
Object... args)
Call this object as a JavaScript function.
|
Object |
eval(String s)
Evaluate a JavaScript expression.
|
String |
getClassName()
ECMA [[Class]] property
|
Object |
getMember(String name)
Retrieves a named member of this JavaScript object.
|
Object |
getSlot(int index)
Retrieves an indexed member of this JavaScript object.
|
boolean |
hasMember(String name)
Does this object have a named member?
|
boolean |
hasSlot(int slot)
Does this object have a indexed property?
|
boolean |
isArray()
Is this an array object?
|
boolean |
isFunction()
Is this a function object?
|
boolean |
isInstance(Object instance)
Checking whether the given object is an instance of 'this' object.
|
boolean |
isInstanceOf(Object clazz)
Checking whether this object is an instance of the given 'clazz' object.
|
boolean |
isStrictFunction()
Is this a 'use strict' function object?
|
Set<String> |
keySet()
Returns the set of all property names of this object.
|
Object |
newObject(Object... args)
Call this 'constructor' JavaScript function to create a new object.
|
void |
removeMember(String name)
Remove a named member from this JavaScript object
|
void |
setMember(String name,
Object value)
Set a named member in this JavaScript object
|
void |
setSlot(int index,
Object value)
Set an indexed member in this JavaScript object
|
double |
toNumber()
Returns this object's numeric value.
|
Collection<Object> |
values()
Returns the set of all property values of this object.
|
public Object call(Object thiz, Object... args)
public Object newObject(Object... args)
public Object getSlot(int index)
public boolean hasMember(String name)
public boolean hasSlot(int slot)
public void removeMember(String name)
removeMember
in interface JSObject
name
- name of the memberpublic void setMember(String name, Object value)
public void setSlot(int index, Object value)
public Collection<Object> values()
public boolean isInstance(Object instance)
isInstance
in interface JSObject
instance
- instace to checkpublic boolean isInstanceOf(Object clazz)
isInstanceOf
in interface JSObject
clazz
- clazz to checkpublic String getClassName()
getClassName
in interface JSObject
public boolean isFunction()
isFunction
in interface JSObject
public boolean isStrictFunction()
isStrictFunction
in interface JSObject
public boolean isArray()
Copyright © 2014, 2015, Oracle and/or its affiliates. All rights reserved.