- 
- All Known Implementing Classes:
- AbstractJSObject,- ScriptObjectMirror
 
 @Deprecated(since="11", forRemoval=true) public interface JSObject Deprecated, for removal: This API element is subject to removal in a future version.Nashorn JavaScript script engine and APIs, and the jjs tool are deprecated with the intent to remove them in a future release.This interface can be implemented by an arbitrary Java class. Nashorn will treat objects of such classes just like nashorn script objects. Usual nashorn operations like obj[i], obj.foo, obj.func(), delete obj.foo will be delegated to appropriate method call of this interface.- Since:
- 1.8u40
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description Objectcall(Object thiz, Object... args)Deprecated, for removal: This API element is subject to removal in a future version.Call this object as a JavaScript function.Objecteval(String s)Deprecated, for removal: This API element is subject to removal in a future version.Evaluate a JavaScript expression.StringgetClassName()Deprecated, for removal: This API element is subject to removal in a future version.ECMA [[Class]] propertydefault ObjectgetDefaultValue(Class<?> hint)Deprecated, for removal: This API element is subject to removal in a future version.Implements this object's[[DefaultValue]]method as per ECMAScript 5.1 section 8.6.2.ObjectgetMember(String name)Deprecated, for removal: This API element is subject to removal in a future version.Retrieves a named member of this JavaScript object.ObjectgetSlot(int index)Deprecated, for removal: This API element is subject to removal in a future version.Retrieves an indexed member of this JavaScript object.booleanhasMember(String name)Deprecated, for removal: This API element is subject to removal in a future version.Does this object have a named member?booleanhasSlot(int slot)Deprecated, for removal: This API element is subject to removal in a future version.Does this object have a indexed property?booleanisArray()Deprecated, for removal: This API element is subject to removal in a future version.Is this an array object?booleanisFunction()Deprecated, for removal: This API element is subject to removal in a future version.Is this a function object?booleanisInstance(Object instance)Deprecated, for removal: This API element is subject to removal in a future version.Checking whether the given object is an instance of 'this' object.booleanisInstanceOf(Object clazz)Deprecated, for removal: This API element is subject to removal in a future version.Checking whether this object is an instance of the given 'clazz' object.booleanisStrictFunction()Deprecated, for removal: This API element is subject to removal in a future version.Is this a 'use strict' function object?Set<String>keySet()Deprecated, for removal: This API element is subject to removal in a future version.Returns the set of all property names of this object.ObjectnewObject(Object... args)Deprecated, for removal: This API element is subject to removal in a future version.Call this 'constructor' JavaScript function to create a new object.voidremoveMember(String name)Deprecated, for removal: This API element is subject to removal in a future version.Remove a named member from this JavaScript objectvoidsetMember(String name, Object value)Deprecated, for removal: This API element is subject to removal in a future version.Set a named member in this JavaScript objectvoidsetSlot(int index, Object value)Deprecated, for removal: This API element is subject to removal in a future version.Set an indexed member in this JavaScript objectdefault doubletoNumber()Deprecated.usegetDefaultValue(Class)withNumberhint instead.Collection<Object>values()Deprecated, for removal: This API element is subject to removal in a future version.Returns the set of all property values of this object.
 
- 
- 
- 
Method Detail- 
callObject call(Object thiz, Object... args) Deprecated, for removal: This API element is subject to removal in a future version.Call this object as a JavaScript function. This is equivalent to 'func.apply(thiz, args)' in JavaScript.- Parameters:
- thiz- 'this' object to be passed to the function. This may be null.
- args- arguments to method
- Returns:
- result of call
 
 - 
newObjectObject newObject(Object... args) Deprecated, for removal: This API element is subject to removal in a future version.Call this 'constructor' JavaScript function to create a new object. This is equivalent to 'new func(arg1, arg2...)' in JavaScript.- Parameters:
- args- arguments to method
- Returns:
- result of constructor call
 
 - 
evalObject eval(String s) Deprecated, for removal: This API element is subject to removal in a future version.Evaluate a JavaScript expression.- Parameters:
- s- JavaScript expression to evaluate
- Returns:
- evaluation result
 
 - 
getMemberObject getMember(String name) Deprecated, for removal: This API element is subject to removal in a future version.Retrieves a named member of this JavaScript object.- Parameters:
- name- of member
- Returns:
- member
- Throws:
- NullPointerException- if name is null
 
 - 
getSlotObject getSlot(int index) Deprecated, for removal: This API element is subject to removal in a future version.Retrieves an indexed member of this JavaScript object.- Parameters:
- index- index slot to retrieve
- Returns:
- member
 
 - 
hasMemberboolean hasMember(String name) Deprecated, for removal: This API element is subject to removal in a future version.Does this object have a named member?- Parameters:
- name- name of member
- Returns:
- true if this object has a member of the given name
 
 - 
hasSlotboolean hasSlot(int slot) Deprecated, for removal: This API element is subject to removal in a future version.Does this object have a indexed property?- Parameters:
- slot- index to check
- Returns:
- true if this object has a slot
 
 - 
removeMembervoid removeMember(String name) Deprecated, for removal: This API element is subject to removal in a future version.Remove a named member from this JavaScript object- Parameters:
- name- name of the member
- Throws:
- NullPointerException- if name is null
 
 - 
setMembervoid setMember(String name, Object value) Deprecated, for removal: This API element is subject to removal in a future version.Set a named member in this JavaScript object- Parameters:
- name- name of the member
- value- value of the member
- Throws:
- NullPointerException- if name is null
 
 - 
setSlotvoid setSlot(int index, Object value)Deprecated, for removal: This API element is subject to removal in a future version.Set an indexed member in this JavaScript object- Parameters:
- index- index of the member slot
- value- value of the member
 
 - 
keySetSet<String> keySet() Deprecated, for removal: This API element is subject to removal in a future version.Returns the set of all property names of this object.- Returns:
- set of property names
 
 - 
valuesCollection<Object> values() Deprecated, for removal: This API element is subject to removal in a future version.Returns the set of all property values of this object.- Returns:
- set of property values.
 
 - 
isInstanceboolean isInstance(Object instance) Deprecated, for removal: This API element is subject to removal in a future version.Checking whether the given object is an instance of 'this' object.- Parameters:
- instance- instance to check
- Returns:
- true if the given 'instance' is an instance of this 'function' object
 
 - 
isInstanceOfboolean isInstanceOf(Object clazz) Deprecated, for removal: This API element is subject to removal in a future version.Checking whether this object is an instance of the given 'clazz' object.- Parameters:
- clazz- clazz to check
- Returns:
- true if this object is an instance of the given 'clazz'
 
 - 
getClassNameString getClassName() Deprecated, for removal: This API element is subject to removal in a future version.ECMA [[Class]] property- Returns:
- ECMA [[Class]] property value of this object
 
 - 
isFunctionboolean isFunction() Deprecated, for removal: This API element is subject to removal in a future version.Is this a function object?- Returns:
- if this mirror wraps a ECMAScript function instance
 
 - 
isStrictFunctionboolean isStrictFunction() Deprecated, for removal: This API element is subject to removal in a future version.Is this a 'use strict' function object?- Returns:
- true if this mirror represents a ECMAScript 'use strict' function
 
 - 
isArrayboolean isArray() Deprecated, for removal: This API element is subject to removal in a future version.Is this an array object?- Returns:
- if this mirror wraps a ECMAScript array object
 
 - 
toNumber@Deprecated default double toNumber() Deprecated.usegetDefaultValue(Class)withNumberhint instead.Returns this object's numeric value.- Returns:
- this object's numeric value.
 
 - 
getDefaultValuedefault Object getDefaultValue(Class<?> hint) throws UnsupportedOperationException Deprecated, for removal: This API element is subject to removal in a future version.Implements this object's[[DefaultValue]]method as per ECMAScript 5.1 section 8.6.2.- Parameters:
- hint- the type hint. Should be either- null,- Number.classor- String.class.
- Returns:
- this object's default value.
- Throws:
- UnsupportedOperationException- if the conversion can't be performed. The engine will convert this exception into a JavaScript- TypeError.
 
 
- 
 
-