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
ConstructorsConstructorDescriptionHybridObject(org.mozilla.javascript.Scriptable scriptable, JsValueAdapter jsValueAdapter) -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete(int index) voidget(int index, org.mozilla.javascript.Scriptable start) getDefaultValue(Class hint) Object[]getIds()org.mozilla.javascript.ScriptablegetProperty(String name) Gets the value of a specified property.Gets the set of names for this record's properties.org.mozilla.javascript.Scriptablebooleanhas(int index, org.mozilla.javascript.Scriptable start) booleanbooleanhasInstance(org.mozilla.javascript.Scriptable instance) voidvoidvoidsetParentScope(org.mozilla.javascript.Scriptable parent) voidsetPrototype(org.mozilla.javascript.Scriptable prototype)
-
Constructor Details
-
HybridObject
-
-
Method Details
-
getProperty
Description copied from interface:RecordGets the value of a specified property.- Specified by:
getPropertyin interfaceRecord<Object>- Parameters:
name- the name of the property- Returns:
- the value of the property or
nullif this record does not have the specified property
-
getPropertyNames
Description copied from interface:RecordGets the set of names for this record's properties.- Specified by:
getPropertyNamesin interfaceRecord<Object>- Returns:
- this record's properties' names
-
getClassName
- Specified by:
getClassNamein interfaceorg.mozilla.javascript.Scriptable
-
get
- Specified by:
getin interfaceorg.mozilla.javascript.Scriptable
-
get
- Specified by:
getin interfaceorg.mozilla.javascript.Scriptable
-
has
- Specified by:
hasin interfaceorg.mozilla.javascript.Scriptable
-
has
public boolean has(int index, org.mozilla.javascript.Scriptable start) - Specified by:
hasin interfaceorg.mozilla.javascript.Scriptable
-
put
- Specified by:
putin interfaceorg.mozilla.javascript.Scriptable
-
put
- Specified by:
putin interfaceorg.mozilla.javascript.Scriptable
-
delete
- Specified by:
deletein interfaceorg.mozilla.javascript.Scriptable
-
delete
public void delete(int index) - Specified by:
deletein interfaceorg.mozilla.javascript.Scriptable
-
getPrototype
public org.mozilla.javascript.Scriptable getPrototype()- Specified by:
getPrototypein interfaceorg.mozilla.javascript.Scriptable
-
setPrototype
public void setPrototype(org.mozilla.javascript.Scriptable prototype) - Specified by:
setPrototypein interfaceorg.mozilla.javascript.Scriptable
-
getParentScope
public org.mozilla.javascript.Scriptable getParentScope()- Specified by:
getParentScopein interfaceorg.mozilla.javascript.Scriptable
-
setParentScope
public void setParentScope(org.mozilla.javascript.Scriptable parent) - Specified by:
setParentScopein interfaceorg.mozilla.javascript.Scriptable
-
getIds
- Specified by:
getIdsin interfaceorg.mozilla.javascript.Scriptable
-
getDefaultValue
- Specified by:
getDefaultValuein interfaceorg.mozilla.javascript.Scriptable
-
hasInstance
public boolean hasInstance(org.mozilla.javascript.Scriptable instance) - Specified by:
hasInstancein interfaceorg.mozilla.javascript.Scriptable
-