Class ScriptableNode
java.lang.Object
org.mozilla.javascript.ScriptableObject
org.apache.sling.scripting.javascript.wrapper.ScriptableBase
org.apache.sling.scripting.javascript.wrapper.ScriptableNode
- All Implemented Interfaces:
Serializable,SlingWrapper,org.mozilla.javascript.ConstProperties,org.mozilla.javascript.debug.DebuggableObject,org.mozilla.javascript.Scriptable,org.mozilla.javascript.Wrapper
- Direct Known Subclasses:
ScriptableVersion,ScriptableVersionHistory
A wrapper for JCR nodes that exposes all properties and child nodes as
properties of a Javascript object.
- See Also:
-
Field Summary
FieldsFields inherited from class org.apache.sling.scripting.javascript.wrapper.ScriptableBase
JSFUNC_PREFIXFields inherited from class org.mozilla.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONSTFields inherited from interface org.mozilla.javascript.Scriptable
NOT_FOUND -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the value of a (Javascript) property or child node.The name of the JavaScript host object "class".getDefaultValue(Class typeHint) Object[]getIds()protected Class<?>Class<?>[]The list of Java classes wrapped by this wrapper.protected ObjectbooleanvoidjsConstructor(Object res) jsFunction_addNode(String path, String primaryType) booleanintintbooleanjavax.jcr.nodetype.NodeType[]booleanbooleanjsFunction_getNode(String path) jsFunction_getNodes(String namePattern) jsFunction_getProperty(String name) Iterator<?>booleanjsFunction_hasNode(String path) voidtoString()unwrap()Methods inherited from class org.apache.sling.scripting.javascript.wrapper.ScriptableBase
getNativeMethods inherited from class org.mozilla.javascript.ScriptableObject
associateValue, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, equivalentValues, get, getAllIds, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, has, hasInstance, hasProperty, hasProperty, isConst, isSealed, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype
-
Field Details
-
CLASSNAME
- See Also:
-
-
Constructor Details
-
ScriptableNode
public ScriptableNode()
-
-
Method Details
-
jsConstructor
-
getClassName
Description copied from interface:SlingWrapperThe name of the JavaScript host object "class".- Specified by:
getClassNamein interfaceorg.mozilla.javascript.Scriptable- Specified by:
getClassNamein interfaceSlingWrapper- Specified by:
getClassNamein classorg.mozilla.javascript.ScriptableObject- Returns:
- the class name
-
getWrappedClasses
Description copied from interface:SlingWrapperThe list of Java classes wrapped by this wrapper.- Specified by:
getWrappedClassesin interfaceSlingWrapper- Returns:
- the wrapped classes
-
getStaticType
- Specified by:
getStaticTypein classScriptableBase- Returns:
- the static type to use for NativeJavaObject wrapping
-
getWrappedObject
- Specified by:
getWrappedObjectin classScriptableBase- Returns:
- the Java object that we're wrapping, used to create a NativeJavaObject instance for default wrapping.
-
jsFunction_addNode
public Object jsFunction_addNode(String path, String primaryType) throws javax.jcr.RepositoryException - Throws:
javax.jcr.RepositoryException
-
jsFunction_getNode
- Throws:
javax.jcr.RepositoryException
-
jsFunction_getChildren
-
jsFunction_getNodes
-
jsFunction_getProperties
-
jsFunction_getPrimaryItem
-
jsFunction_getProperty
- Throws:
javax.jcr.RepositoryException
-
jsFunction_getUUID
-
jsFunction_getIndex
public int jsFunction_getIndex() -
jsFunction_getReferences
-
jsFunction_getPrimaryNodeType
-
jsFunction_getMixinNodeTypes
public javax.jcr.nodetype.NodeType[] jsFunction_getMixinNodeTypes() -
jsFunction_getDefinition
-
jsFunction_getCheckedOut
public boolean jsFunction_getCheckedOut() -
jsFunction_getVersionHistory
-
jsFunction_getBaseVersion
-
jsFunction_getLock
-
jsFunction_getLocked
public boolean jsFunction_getLocked() -
jsFunction_getSession
-
jsFunction_getPath
-
jsFunction_getName
-
jsFunction_getParent
-
jsFunction_getDepth
public int jsFunction_getDepth() -
jsFunction_getNew
public boolean jsFunction_getNew() -
jsFunction_getModified
public boolean jsFunction_getModified() -
jsFunction_remove
public void jsFunction_remove() throws javax.jcr.RepositoryException- Throws:
javax.jcr.RepositoryException
-
jsFunction_hasNode
- Throws:
javax.jcr.RepositoryException
-
get
Gets the value of a (Javascript) property or child node. If there is a single single-value JCR property of this node, return its string value. If there are multiple properties of the same name or child nodes of the same name, return an array.- Specified by:
getin interfaceorg.mozilla.javascript.Scriptable- Overrides:
getin classorg.mozilla.javascript.ScriptableObject
-
getIds
- Specified by:
getIdsin interfaceorg.mozilla.javascript.Scriptable- Overrides:
getIdsin classorg.mozilla.javascript.ScriptableObject
-
getDefaultValue
- Specified by:
getDefaultValuein interfaceorg.mozilla.javascript.Scriptable- Overrides:
getDefaultValuein classorg.mozilla.javascript.ScriptableObject
-
has
- Specified by:
hasin interfaceorg.mozilla.javascript.Scriptable- Overrides:
hasin classorg.mozilla.javascript.ScriptableObject
-
toString
-
unwrap
- Specified by:
unwrapin interfaceorg.mozilla.javascript.Wrapper
-