public interface JSObject
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.
|
Object call(Object thiz, Object... args)
thiz
- 'this' object to be passed to the functionargs
- arguments to methodObject newObject(Object... args)
args
- arguments to methodObject eval(String s)
s
- JavaScript expression to evaluateObject getMember(String name)
name
- of memberObject getSlot(int index)
index
- index slot to retrieveboolean hasMember(String name)
name
- name of memberboolean hasSlot(int slot)
slot
- index to checkvoid removeMember(String name)
name
- name of the membervoid setMember(String name, Object value)
name
- name of the membervalue
- value of the membervoid setSlot(int index, Object value)
index
- index of the member slotvalue
- value of the memberSet<String> keySet()
Collection<Object> values()
boolean isInstance(Object instance)
instance
- instace to checkboolean isInstanceOf(Object clazz)
clazz
- clazz to checkString getClassName()
boolean isFunction()
boolean isStrictFunction()
boolean isArray()
double toNumber()
Copyright © 2014, 2015, Oracle and/or its affiliates. All rights reserved.