Class HybridObject
java.lang.Object
org.apache.sling.scripting.sightly.js.impl.rhino.HybridObject
public class HybridObject
extends Object
implements org.mozilla.javascript.Scriptable, Record<Object>
Instances of this class can be used in both HTL & JavaScript scripts.
-
Field Summary
Fields inherited from interface org.mozilla.javascript.Scriptable
NOT_FOUND
-
Constructor Summary
ConstructorDescriptionHybridObject
(org.mozilla.javascript.Scriptable scriptable, JsValueAdapter jsValueAdapter) -
Method Summary
Modifier and TypeMethodDescriptionvoid
delete
(int index) void
get
(int index, org.mozilla.javascript.Scriptable start) getDefaultValue
(Class hint) Object[]
getIds()
org.mozilla.javascript.Scriptable
getProperty
(String name) Gets the value of a specified property.Gets the set of names for this record's properties.org.mozilla.javascript.Scriptable
boolean
has
(int index, org.mozilla.javascript.Scriptable start) boolean
boolean
hasInstance
(org.mozilla.javascript.Scriptable instance) void
void
void
setParentScope
(org.mozilla.javascript.Scriptable parent) void
setPrototype
(org.mozilla.javascript.Scriptable prototype)
-
Constructor Details
-
HybridObject
-
-
Method Details
-
getProperty
Description copied from interface:Record
Gets the value of a specified property.- Specified by:
getProperty
in interfaceRecord<Object>
- Parameters:
name
- the name of the property- Returns:
- the value of the property or
null
if this record does not have the specified property
-
getPropertyNames
Description copied from interface:Record
Gets the set of names for this record's properties.- Specified by:
getPropertyNames
in interfaceRecord<Object>
- Returns:
- this record's properties' names
-
getClassName
- Specified by:
getClassName
in interfaceorg.mozilla.javascript.Scriptable
-
get
- Specified by:
get
in interfaceorg.mozilla.javascript.Scriptable
-
get
- Specified by:
get
in interfaceorg.mozilla.javascript.Scriptable
-
has
- Specified by:
has
in interfaceorg.mozilla.javascript.Scriptable
-
has
public boolean has(int index, org.mozilla.javascript.Scriptable start) - Specified by:
has
in interfaceorg.mozilla.javascript.Scriptable
-
put
- Specified by:
put
in interfaceorg.mozilla.javascript.Scriptable
-
put
- Specified by:
put
in interfaceorg.mozilla.javascript.Scriptable
-
delete
- Specified by:
delete
in interfaceorg.mozilla.javascript.Scriptable
-
delete
public void delete(int index) - Specified by:
delete
in interfaceorg.mozilla.javascript.Scriptable
-
getPrototype
public org.mozilla.javascript.Scriptable getPrototype()- Specified by:
getPrototype
in interfaceorg.mozilla.javascript.Scriptable
-
setPrototype
public void setPrototype(org.mozilla.javascript.Scriptable prototype) - Specified by:
setPrototype
in interfaceorg.mozilla.javascript.Scriptable
-
getParentScope
public org.mozilla.javascript.Scriptable getParentScope()- Specified by:
getParentScope
in interfaceorg.mozilla.javascript.Scriptable
-
setParentScope
public void setParentScope(org.mozilla.javascript.Scriptable parent) - Specified by:
setParentScope
in interfaceorg.mozilla.javascript.Scriptable
-
getIds
- Specified by:
getIds
in interfaceorg.mozilla.javascript.Scriptable
-
getDefaultValue
- Specified by:
getDefaultValue
in interfaceorg.mozilla.javascript.Scriptable
-
hasInstance
public boolean hasInstance(org.mozilla.javascript.Scriptable instance) - Specified by:
hasInstance
in interfaceorg.mozilla.javascript.Scriptable
-