- java.lang.Object
- 
- jdk.nashorn.api.scripting.AbstractJSObject
 
- 
- All Implemented Interfaces:
- JSObject
 - Direct Known Subclasses:
- ScriptObjectMirror
 
 @Deprecated(since="11", forRemoval=true) public abstract class AbstractJSObject extends Object implements 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 is the base class for nashorn ScriptObjectMirror class. This class can also be subclassed 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 class.- Since:
- 1.8u40
 
- 
- 
Constructor SummaryConstructors Constructor Description AbstractJSObject()Deprecated, for removal: This API element is subject to removal in a future version.The default constructor.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete 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.static ObjectgetDefaultValue(JSObject jsobj, Class<?> hint)Deprecated.useJSObject.getDefaultValue(Class)instead.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.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 objectdoubletoNumber()Deprecated.useJSObject.getDefaultValue(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.- 
Methods declared in class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods declared in interface jdk.nashorn.api.scripting.JSObjectgetClassName, getDefaultValue, isInstanceOf
 
- 
 
- 
- 
- 
Method Detail- 
callpublic Object call(Object thiz, Object... args) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:JSObjectCall this object as a JavaScript function. This is equivalent to 'func.apply(thiz, args)' in JavaScript.
 - 
newObjectpublic Object newObject(Object... args) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:JSObjectCall this 'constructor' JavaScript function to create a new object. This is equivalent to 'new func(arg1, arg2...)' in JavaScript.
 - 
evalpublic Object eval(String s) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:JSObjectEvaluate a JavaScript expression.
 - 
getMemberpublic Object getMember(String name) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:JSObjectRetrieves a named member of this JavaScript object.
 - 
getSlotpublic Object getSlot(int index) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:JSObjectRetrieves an indexed member of this JavaScript object.
 - 
hasMemberpublic boolean hasMember(String name) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:JSObjectDoes this object have a named member?
 - 
hasSlotpublic boolean hasSlot(int slot) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:JSObjectDoes this object have a indexed property?
 - 
removeMemberpublic void removeMember(String name) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:JSObjectRemove a named member from this JavaScript object- Specified by:
- removeMemberin interface- JSObject
- Implementation Requirements:
- This implementation is a no-op
- Parameters:
- name- name of the member
 
 - 
setMemberpublic void setMember(String name, Object value) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:JSObjectSet a named member in this JavaScript object
 - 
setSlotpublic void setSlot(int index, Object value)Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:JSObjectSet an indexed member in this JavaScript object
 - 
keySetpublic Set<String> keySet() Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:JSObjectReturns the set of all property names of this object.
 - 
valuespublic Collection<Object> values() Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:JSObjectReturns the set of all property values of this object.
 - 
isInstancepublic boolean isInstance(Object instance) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:JSObjectChecking whether the given object is an instance of 'this' object.- Specified by:
- isInstancein interface- JSObject
- Implementation Requirements:
- This implementation always returns false
- Parameters:
- instance- instance to check
- Returns:
- true if the given 'instance' is an instance of this 'function' object
 
 - 
isFunctionpublic boolean isFunction() Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:JSObjectIs this a function object?- Specified by:
- isFunctionin interface- JSObject
- Implementation Requirements:
- This implementation always returns false
- Returns:
- if this mirror wraps a ECMAScript function instance
 
 - 
isStrictFunctionpublic boolean isStrictFunction() Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:JSObjectIs this a 'use strict' function object?- Specified by:
- isStrictFunctionin interface- JSObject
- Implementation Requirements:
- This implementation always returns false
- Returns:
- true if this mirror represents a ECMAScript 'use strict' function
 
 - 
isArraypublic boolean isArray() Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:JSObjectIs this an array object?
 - 
toNumber@Deprecated public double toNumber() Deprecated.useJSObject.getDefaultValue(Class)withNumberhint instead.Returns this object's numeric value.
 - 
getDefaultValue@Deprecated public static Object getDefaultValue(JSObject jsobj, Class<?> hint) Deprecated.useJSObject.getDefaultValue(Class)instead.When passed anAbstractJSObject, invokes itsJSObject.getDefaultValue(Class)method. When passed any otherJSObject, it will obtain its[[DefaultValue]]method as per ECMAScript 5.1 section 8.6.2.- Parameters:
- jsobj- the- JSObjectwhose- [[DefaultValue]]is obtained.
- 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.
 
 
- 
 
-