- java.lang.Object
- 
- jdk.nashorn.api.scripting.AbstractJSObject
- 
- jdk.nashorn.api.scripting.ScriptObjectMirror
 
 
- 
 @Deprecated(since="11", forRemoval=true) public final class ScriptObjectMirror extends AbstractJSObject implements Bindings 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.Mirror object that wraps a given Nashorn Script object.- Since:
- 1.8u40
 
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ObjectcallMember(String functionName, Object... args)Deprecated, for removal: This API element is subject to removal in a future version.Call member functionbooleandelete(Object key)Deprecated, for removal: This API element is subject to removal in a future version.Delete a property from this object.ScriptObjectMirrorfreeze()Deprecated, for removal: This API element is subject to removal in a future version.ECMA 15.2.39 - freeze implementation.String[]getOwnKeys(boolean all)Deprecated, for removal: This API element is subject to removal in a future version.return an array of own property keys associated with the object.ObjectgetOwnPropertyDescriptor(String key)Deprecated, for removal: This API element is subject to removal in a future version.ECMA 8.12.1 [[GetOwnProperty]] (P)ObjectgetProto()Deprecated, for removal: This API element is subject to removal in a future version.Return the __proto__ of this object.static booleanidentical(Object obj1, Object obj2)Deprecated, for removal: This API element is subject to removal in a future version.Are the given objects mirrors to same underlying object?booleanisExtensible()Deprecated, for removal: This API element is subject to removal in a future version.Check if this script object is extensiblebooleanisFrozen()Deprecated, for removal: This API element is subject to removal in a future version.Check whether this script object is frozenbooleanisSealed()Deprecated, for removal: This API element is subject to removal in a future version.Check whether this script object is sealedstatic booleanisUndefined(Object obj)Deprecated, for removal: This API element is subject to removal in a future version.Utility to check if given object is ECMAScript undefined valueScriptObjectMirrorpreventExtensions()Deprecated, for removal: This API element is subject to removal in a future version.Flag this script object as non extensibleScriptObjectMirrorseal()Deprecated, for removal: This API element is subject to removal in a future version.ECMAScript 15.2.3.8 - seal implementationvoidsetIndexedPropertiesToExternalArrayData(ByteBuffer buf)Deprecated, for removal: This API element is subject to removal in a future version.Nashorn extension: setIndexedPropertiesToExternalArrayData.voidsetProto(Object proto)Deprecated, for removal: This API element is subject to removal in a future version.Set the __proto__ of this object.<T> Tto(Class<T> type)Deprecated, for removal: This API element is subject to removal in a future version.Utility to convert this script object to the given type.static Objectunwrap(Object obj, Object homeGlobal)Deprecated, for removal: This API element is subject to removal in a future version.Unwrap a script object mirror if needed.static Object[]unwrapArray(Object[] args, Object homeGlobal)Deprecated, for removal: This API element is subject to removal in a future version.Unwrap an array of script object mirrors if needed.static Objectwrap(Object obj, Object homeGlobal)Deprecated, for removal: This API element is subject to removal in a future version.Make a script object mirror on given object if needed.static Object[]wrapArray(Object[] args, Object homeGlobal)Deprecated, for removal: This API element is subject to removal in a future version.Wrap an array of object to script object mirrors if needed.static ObjectwrapAsJSONCompatible(Object obj, Object homeGlobal)Deprecated, for removal: This API element is subject to removal in a future version.Make a script object mirror on given object if needed.- 
Methods declared in class jdk.nashorn.api.scripting.AbstractJSObjectcall, eval, getDefaultValue, getMember, getSlot, hasMember, hasSlot, isArray, isFunction, isInstance, isStrictFunction, keySet, newObject, removeMember, setMember, setSlot, toNumber, values
 - 
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
 - 
Methods declared in interface java.util.Mapclear, compute, computeIfAbsent, computeIfPresent, containsValue, entrySet, equals, forEach, getOrDefault, hashCode, isEmpty, keySet, merge, putIfAbsent, remove, replace, replace, replaceAll, size, values
 
- 
 
- 
- 
- 
Method Detail- 
callMemberpublic Object callMember(String functionName, Object... args) Deprecated, for removal: This API element is subject to removal in a future version.Call member function- Parameters:
- functionName- function name
- args- arguments
- Returns:
- return value of function
 
 - 
setIndexedPropertiesToExternalArrayDatapublic void setIndexedPropertiesToExternalArrayData(ByteBuffer buf) Deprecated, for removal: This API element is subject to removal in a future version.Nashorn extension: setIndexedPropertiesToExternalArrayData. set indexed properties be exposed from a given nio ByteBuffer.- Parameters:
- buf- external buffer - should be a nio ByteBuffer
 
 - 
deletepublic boolean delete(Object key) Deprecated, for removal: This API element is subject to removal in a future version.Delete a property from this object.- Parameters:
- key- the property to be deleted
- Returns:
- if the delete was successful or not
 
 - 
getProtopublic Object getProto() Deprecated, for removal: This API element is subject to removal in a future version.Return the __proto__ of this object.- Returns:
- __proto__ object.
 
 - 
setProtopublic void setProto(Object proto) Deprecated, for removal: This API element is subject to removal in a future version.Set the __proto__ of this object.- Parameters:
- proto- new proto for this object
 
 - 
getOwnPropertyDescriptorpublic Object getOwnPropertyDescriptor(String key) Deprecated, for removal: This API element is subject to removal in a future version.ECMA 8.12.1 [[GetOwnProperty]] (P)- Parameters:
- key- property key
- Returns:
- Returns the Property Descriptor of the named own property of this object, or undefined if absent.
 
 - 
getOwnKeyspublic String[] getOwnKeys(boolean all) Deprecated, for removal: This API element is subject to removal in a future version.return an array of own property keys associated with the object.- Parameters:
- all- True if to include non-enumerable keys.
- Returns:
- Array of keys.
 
 - 
preventExtensionspublic ScriptObjectMirror preventExtensions() Deprecated, for removal: This API element is subject to removal in a future version.Flag this script object as non extensible- Returns:
- the object after being made non extensible
 
 - 
isExtensiblepublic boolean isExtensible() Deprecated, for removal: This API element is subject to removal in a future version.Check if this script object is extensible- Returns:
- true if extensible
 
 - 
sealpublic ScriptObjectMirror seal() Deprecated, for removal: This API element is subject to removal in a future version.ECMAScript 15.2.3.8 - seal implementation- Returns:
- the sealed script object
 
 - 
isSealedpublic boolean isSealed() Deprecated, for removal: This API element is subject to removal in a future version.Check whether this script object is sealed- Returns:
- true if sealed
 
 - 
freezepublic ScriptObjectMirror freeze() Deprecated, for removal: This API element is subject to removal in a future version.ECMA 15.2.39 - freeze implementation. Freeze this script object- Returns:
- the frozen script object
 
 - 
isFrozenpublic boolean isFrozen() Deprecated, for removal: This API element is subject to removal in a future version.Check whether this script object is frozen- Returns:
- true if frozen
 
 - 
isUndefinedpublic static boolean isUndefined(Object obj) Deprecated, for removal: This API element is subject to removal in a future version.Utility to check if given object is ECMAScript undefined value- Parameters:
- obj- object to check
- Returns:
- true if 'obj' is ECMAScript undefined value
 
 - 
topublic <T> T to(Class<T> type) Deprecated, for removal: This API element is subject to removal in a future version.Utility to convert this script object to the given type.- Type Parameters:
- T- destination type to convert to
- Parameters:
- type- destination type to convert to
- Returns:
- converted object
 
 - 
wrappublic static Object wrap(Object obj, Object homeGlobal) Deprecated, for removal: This API element is subject to removal in a future version.Make a script object mirror on given object if needed.- Parameters:
- obj- object to be wrapped/converted
- homeGlobal- global to which this object belongs.
- Returns:
- wrapped/converted object
 
 - 
wrapAsJSONCompatiblepublic static Object wrapAsJSONCompatible(Object obj, Object homeGlobal) Deprecated, for removal: This API element is subject to removal in a future version.Make a script object mirror on given object if needed. The created wrapper will implement the JavaListinterface ifobjis a JavaScriptArrayobject; this is compatible with Java JSON libraries expectations. Arrays retrieved through its properties (transitively) will also implement the list interface.- Parameters:
- obj- object to be wrapped/converted
- homeGlobal- global to which this object belongs.
- Returns:
- wrapped/converted object
 
 - 
unwrappublic static Object unwrap(Object obj, Object homeGlobal) Deprecated, for removal: This API element is subject to removal in a future version.Unwrap a script object mirror if needed.- Parameters:
- obj- object to be unwrapped
- homeGlobal- global to which this object belongs
- Returns:
- unwrapped object
 
 - 
wrapArraypublic static Object[] wrapArray(Object[] args, Object homeGlobal) Deprecated, for removal: This API element is subject to removal in a future version.Wrap an array of object to script object mirrors if needed.- Parameters:
- args- array to be unwrapped
- homeGlobal- global to which this object belongs
- Returns:
- wrapped array
 
 - 
unwrapArraypublic static Object[] unwrapArray(Object[] args, Object homeGlobal) Deprecated, for removal: This API element is subject to removal in a future version.Unwrap an array of script object mirrors if needed.- Parameters:
- args- array to be unwrapped
- homeGlobal- global to which this object belongs
- Returns:
- unwrapped array
 
 - 
identicalpublic static boolean identical(Object obj1, Object obj2) Deprecated, for removal: This API element is subject to removal in a future version.Are the given objects mirrors to same underlying object?- Parameters:
- obj1- first object
- obj2- second object
- Returns:
- true if obj1 and obj2 are identical script objects or mirrors of it.
 
 
- 
 
-