Returns the ancestor of this Item at the specified depth. An ancestor of depth x is the Item that is x levels down along the path from the root node to this Item. depth = 0 returns the root node of a workspace. depth = 1 returns the child of the root node along the path to this Item. depth = 2 returns the grandchild of the root node along the path to this Item. And so on to depth = n, where n is the depth of this Item, which returns this Item itself.
If this node has more than one path (i.e., if it is a descendant of a shared node) then the path used to define the ancestor is implementaion-dependent.
An integer, 0 <= depth <= n where n is the depth of this Item.
The ancestor of this Item at the specified depth.
ItemNotFoundException if depth < 0 or depth > n where n is the is the depth of this item.
AccessDeniedException if the current session does not have sufficent access to retrieve the specified node.
RepositoryException if another error occurs.
Returns the name of this Item in qualified form. If this Item is the root node of the workspace, an empty string is returned.
the name of this Item in qualified form or an empty string if this Item is the root node of a workspace.
RepositoryException if an error occurs.
Returns the node at relPath relative to this node.
If relPath contains a path element that refers to a node with same-name sibling nodes without explicitly including an index using the array-style notation ([x]), then the index [1] is assumed (indexing of same name siblings begins at 1, not 0, in order to preserve compatibility with XPath).
Within the scope of a single Session object, if a Node object has been acquired, any subsequent call of getNode reacquiring the same node must return a Node object reflecting the same state as the earlier Node object. Whether this object is actually the same Node instance, or simply one wrapping the same state, is up to the implementation.
The relative path of the node to retrieve.
The node at relPath.
PathNotFoundException if no node exists at the specified path or the current Session does not read access to the node at the specified path.
RepositoryException If another error occurs.
Returns all child nodes of this node accessible through the current Session. Does not include properties of this Node. The same reacquisition semantics apply as with #getNode(String). If this node has no accessible child nodes, then an empty iterator is returned.
A NodeIterator over all child Nodes of this Node.
RepositoryException if an error occurs.
Gets all child nodes of this node accessible through the current Session that match namePattern. The pattern may be a full name or a partial name with one or more wildcard characters ("*"), or a disjunction (using the "|" character to represent logical OR) of these. For example,
N.getNodes("jcr:* | myapp:report | my doc")
would return a NodeIterator holding all accessible child nodes of N that are either called 'myapp:report', begin with the prefix 'jcr:' or are called 'my doc'.
The substrings within the pattern that are delimited by "|" characters and which may contain wildcard characters ("*") are called globs.
Note that leading and trailing whitespace around a glob is ignored, but whitespace within a disjunct forms part of the pattern to be matched.
The pattern is matched against the names (not the paths) of the immediate child nodes of this node.
If this node has no accessible matching child nodes, then an empty iterator is returned.
The same reacquisition semantics apply as with #getNode(String).
a name pattern.
a NodeIterator.
RepositoryException if an unexpected error occurs.
Gets all child nodes of this node accessible through the current Session that match one or more of the nameGlob strings in the passed array.
A glob may be a full name or a partial name with one or more wildcard characters ("*"). For example,
N.getNodes(new String[] {"jcr:*", "myapp:report", "my doc"})
would return a NodeIterator holding all accessible child nodes of N that are either called 'myapp:report', begin with the prefix 'jcr:' or are called 'my doc'.
Note that unlike in the case of the #getNodes(String) leading and trailing whitespace around a glob is not ignored.
The globs are matched against the names (not the paths) of the immediate child nodes of this node.
If this node has no accessible matching child nodes, then an empty iterator is returned.
The same reacquisition semantics apply as with #getNode(String).
an array of globbing strings.
a NodeIterator.
RepositoryException if an unexpected error occurs.
JCR 2.0
Returns the parent of this Item.
The parent of this Item.
ItemNotFoundException if this Item is the root node of a workspace.
AccessDeniedException if the current session does not have sufficent access to retrieve the parent of this item.
RepositoryException if another error occurs.
Returns all properties of this node accessible through the current Session. Does not include child nodes of this node. The same reacquisition semantics apply as with #getNode(String). If this node has no accessible properties, then an empty iterator is returned.
A PropertyIterator.
RepositoryException if an error occurs.
Gets all properties of this node accessible through the current Session that match namePattern. The pattern may be a full name or a partial name with one or more wildcard characters ("*"), or a disjunction (using the "|" character to represent logical OR) of these. For example,
N.getProperties("jcr:* | myapp:name | my doc")
would return a PropertyIterator holding all accessible properties of N that are either called 'myapp:name', begin with the prefix 'jcr:' or are called 'my doc'.
The substrings within the pattern that are delimited by "|" characters and which may contain wildcard characters ("*") are called globs.
Note that leading and trailing whitespace around a glob is ignored, but whitespace within a disjunct forms part of the pattern to be matched.
The pattern is matched against the names (not the paths) of the immediate child properties of this node.
If this node has no accessible matching properties, then an empty iterator is returned.
The same reacquisition semantics apply as with #getNode(String).
a name pattern.
a PropertyIterator.
RepositoryException if an unexpected error occurs.
Gets all properties of this node accessible through the current Session that match one or more of the nameGlob strings in the passed array.
A glob may be a full name or a partial name with one or more wildcard characters ("*"). For example,
N.getProperties(new String[] {"jcr:*", "myapp:report", "my doc"})
would return a PropertyIterator holding all accessible properties of N that are either called 'myapp:report', begin with the prefix 'jcr:' or are called 'my doc'.
Note that unlike in the case of the #getProperties(String) leading and trailing whitespace around a glob is not ignored.
The globs are matched against the names (not the paths) of the properties of this node.
If this node has no accessible matching properties, then an empty iterator is returned.
The same reacquisition semantics apply as with #getProperty(String).
an array of globbing strings.
a PropertyIterator.
RepositoryException if an unexpected error occurs.
JCR 2.0
Returns the property at relPath relative to this node. The same reacquisition semantics apply as with #getNode(String).
The relative path of the property to retrieve.
The property at relPath.
PathNotFoundException if no property exists at the specified path or if the current
Session does not have read access to the specified
property.
RepositoryException If another error occurs.
This method returns all REFERENCE properties that refer to this node and that are accessible through the current Session. Equivalent to Node.getReferences(null).
If this node has no referring REFERENCE properties, an empty iterator is returned. This includes the case where this node is not referenceable.
A PropertyIterator.
RepositoryException if an error occurs.
#getReferences(String).
This method returns all REFERENCE properties that refer to this node, have the specified name and that are accessible through the current Session.
If the name parameter is null then all referring REFERENCES are returned regardless of name.
Some implementations may only return properties that have been persisted. Some may return both properties that have been persisted and those that have been dispatched but not persisted (for example, those saved within a transaction but not yet committed) while others implementations may return these two categories of property as well as properties that are still pending and not yet dispatched.
In implementations that support versioning, this method does not return properties that are part of the frozen state of a version in version storage.
If this node has no referring REFERENCE properties with the specified name, an empty iterator is returned. This includes the case where this node is not referenceable.
name of referring REFERENCE properties to be returned; if null then all referring REFERENCEs are returned.
A PropertyIterator.
RepositoryException if an error occurs.
JCR 2.0
Returns the UUID of this node as recorded in this node's jcr:uuid property. This method only works on nodes of mixin node type mix:referenceable.
On nonreferenceable nodes, this method throws an UnsupportedRepositoryOperationException. To avoid throwing an exception to determine whether a node has a UUID, a call to #isNodeType(String) isNodeType("mix:referenceable") can be made.
the UUID of this node.
UnsupportedRepositoryOperationException if this node nonreferenceable.
RepositoryException if another error occurs.
As of JCR 2.0, #getIdentifier() should be used instead.
This method returns all WEAKREFERENCE properties that refer to this node and that are accessible through the current Session. Equivalent to Node.getWeakReferences(null).
If this node has no referring WEAKREFERENCE properties, an empty iterator is returned. This includes the case where this node is not referenceable.
A PropertyIterator.
RepositoryException if an error occurs.
#getWeakReferences(String).
JCR 2.0
This method returns all WEAKREFERENCE properties that refer to this node, have the specified name and that are accessible through the current Session.
If the name parameter is null then all referring WEAKREFERENCE are returned regardless of name.
Some implementations may only return properties that have been persisted. Some may return both properties that have been persisted and those that have been dispatched but not persisted (for example, those saved within a transaction but not yet committed) while others implementations may return these two categories of property as well as properties that are still pending and not yet dispatched.
In implementations that support versioning, this method does not return properties that are part of the frozen state of a version in version storage.
If this node has no referring WEAKREFERENCE properties with the specified name, an empty iterator is returned. This includes the case where this node is not referenceable.
name of referring WEAKREFERENCE properties to be returned; if null then all referring WEAKREFERENCEs are returned.
A PropertyIterator.
RepositoryException if an error occurs.
JCR 2.0
Indicates whether a node exists at relPath Returns true if a node accessible through the current Session exists at relPath and false otherwise.
The path of a (possible) node.
true if a node exists at relPath; false otherwise.
RepositoryException if an error occurs.
Indicates whether this node has properties. Returns true if this node has one or more properties accessible through the current Session; false otherwise.
true if this node has one or more properties; false otherwise.
RepositoryException if an error occurs.
Indicates whether a property exists at relPath Returns true if a property accessible through the current Session exists at relPath and false otherwise.
The path of a (possible) property.
true if a property exists at relPath; false otherwise.
RepositoryException if an error occurs.
Returns false if this node is currently in the checked-in state (either due to its own status as a versionable node or due to the effect of a versionable node being checked in above it). Otherwise this method returns true. This includes the case where the repository does not support versioning (and therefore all nodes are always "checked-out", by default).
a boolean
RepositoryException if an error occurs.
Returns true if this node is locked either as a result of a lock held by this node or by a deep lock on a node above this node; otherwise returns false. This includes the case where a repository does not support locking (in which case all nodes are "unlocked" by default).
a boolean.
RepositoryException if an error occurs.
Returns true if this Item has been saved but has subsequently been modified through the current session and therefore the state of this item as recorded in the session differs from the state of this item as saved. Within a transaction, isModified on an Item may return false (because the Item has been saved since the modification) even if the modification in question is not in persistent storage (because the transaction has not yet been committed).
Note that in read-only implementations, this method will always return false.
true if this item is modified; false otherwise.
Returns true if this is a new item, meaning that it exists only in transient storage on the Session and has not yet been saved. Within a transaction, isNew on an Item may return false (because the item has been saved) even if that Item is not in persistent storage (because the transaction has not yet been committed).
Note that if an item returns true on isNew, then by definition is parent will return true on isModified.
Note that in read-only implementations, this method will always return false.
true if this item is new; false otherwise.
Returns true if this node is of the specified primary node type or mixin type, or a subtype thereof. Returns false otherwise.
This method respects the effective node type of the node.
the name of a node type.
true If this node is of the specified primary node type or mixin type, or a subtype thereof. Returns false otherwise.
RepositoryException if an error occurs.
Returns true if this Item object (the Java object instance) represents the same actual workspace item as the object otherItem.
Two Item objects represent the same workspace item if and only if all the following are true: Both objects were acquired through Session objects that were created by the same Repository object. Both objects were acquired through Session objects bound to the same repository workspace. The objects are either both Node objects or both Property objects. If they are Node objects, they have the same identifier. If they are Property objects they have identical names and isSame is true of their parent nodes. This method does not compare the states of the two items. For example, if two Item objects representing the same actual workspace item have been retrieved through two different sessions and one has been modified, then this method will still return true when comparing these two objects. Note that if two Item objects representing the same workspace item are retrieved through the same session they will always reflect the same state.
the Item object to be tested for identity with this Item.
true if this Item object and otherItem represent the same actual repository item; false otherwise.
RepositoryException if an error occurs.
The Node interface represents a node in a workspace.