|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Node
Node Interface for accessing readable properties a node in the ECM. An object implementing only this interface is immutable.
| Method Summary | |
|---|---|
java.util.Date |
getAccessed()
cm:accessed mandatory property with direct accessor. |
Node |
getAncestor(int degree)
From JCR Item interface, probably useful. |
java.lang.String |
getCorrespondingNodePath()
(adapted) From JCR Node interface, needed. |
java.util.Date |
getCreated()
cm:created mandatory property with direct accessor. |
java.lang.String |
getCreator()
cm:creator mandatory property with direct accessor. |
int |
getDepth()
From JCR Item interface, probably useful. |
java.lang.String |
getDescription()
cm:description mandatory property with direct accessor. |
int |
getIndex()
From JCR Node interface, needed. |
java.util.Date |
getModified()
cm:modified mandatory property with direct accessor. |
java.lang.String |
getModifier()
cm:modifier mandatory property with direct accessor. |
java.lang.String |
getName()
From JCR Item interface, probably needed. |
Node |
getNode(java.lang.String relPath)
From JCR Node interface, needed. |
java.util.List<Node> |
getNodes()
From JCR Node interface, needed. |
java.util.List<Node> |
getNodes(java.lang.String namePattern)
From JCR Node interface, needed. |
Node |
getParent()
From JCR Item interface, needed. |
java.lang.String |
getPath()
From JCR Item interface, needed. |
Node |
getPrimaryItem()
From JCR Node interface, probably useful. |
java.util.List<javax.jcr.Property> |
getProperties()
From JCR Node interface, needed. |
java.util.List<javax.jcr.Property> |
getProperties(java.lang.String namePattern)
From JCR Node interface, needed. |
javax.jcr.Property |
getProperty(java.lang.String relPath)
From JCR Node interface, needed. |
java.lang.String |
getTitle()
cm:title mandatory property with direct accessor. |
java.lang.String |
getUUID()
From JCR Node interface, needed. |
boolean |
hasNode(java.lang.String relPath)
From JCR Node interface, needed. |
boolean |
hasNodes()
From JCR Node interface, needed. |
boolean |
hasProperties()
From JCR Node interface, needed. |
boolean |
hasProperty(java.lang.String relPath)
From JCR Node interface, needed. |
boolean |
isSame(Node otherNode)
From JCR Item interface, may be useful. |
| Method Detail |
|---|
Node getAncestor(int degree)
Item that is x levels down along the path
from the root node to this Item.
Item.
Item.
Item, which returns this
Item itself.
ItemNotFoundException is thrown.
depth - An integer, 0 <= depth <= n where
n is the depth of this Item.
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 sufficient access
rights to retrieve the specified node.
RepositoryException - if another error occurs.
int getDepth()
throws java.lang.Exception
Item (counting this
Item itself).
Item.
Item in the workspace hierarchy.
RepositoryException - if an error occurs.
java.lang.Exception
java.lang.String getName()
throws java.lang.Exception
Item. The name of an item is the
last element in its path, minus any square-bracket index that may exist.
If this Item is the root node of the workspace (i.e., if
this.getDepth() == 0), an empty string will be returned.
Item or an empty string if
this Item is the root node.
RepositoryException - if an error occurs.
java.lang.Exception
Node getParent()
throws java.lang.Exception
Item.
Item.
ItemNotFoundException - if there is no parent. This only happens if this item is
the root node of a workspace.
AccessDeniedException - if the current session does not have sufficient access
rights to retrieve the parent of this item.
RepositoryException - if another error occurs.
java.lang.Exception
java.lang.String getPath()
throws java.lang.Exception
/a/b[3]/c).
Item.
RepositoryException - if an error occurs.
java.lang.Exception
boolean isSame(Node otherNode)
throws java.lang.Exception
true if this Node object (the Java
object instance) represents the same actual repository item as the object
otherNode.
This method does not compare the states of the two items. For
example, if two Node objects representing the same actual
repository item have been retrieved through two different sessions and
one has been modified, then this method will still return
true for these two objects. Note that if two
Node objects representing the same repository item are
retrieved through the same session they will always reflect the
same state (see section 6.3.1 Reflecting Node State in the
specification document) so comparing state is not an issue.
otherNode - the Node object to be tested for identity
with this Node.
true if this Node object and
otherNode represent the same actual repository
item; false otherwise.
RepositoryException - if an error occurs.
java.lang.Exception
Node getNode(java.lang.String relPath)
throws java.lang.Exception
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.
relPath - The relative path of the node to retrieve.
relPath.
PathNotFoundException - If no node exists at the specified path.
RepositoryException - If another error occurs.
java.lang.Exception
java.util.List<Node> getNodes()
throws java.lang.Exception
NodeIterator over all child Nodes
of this Node. Does not include properties of this
Node. The same reacquisition semantics apply as with
getNode(String). If this node has no child nodes, then an empty
iterator is returned.
NodeIterator over all child Nodes
of this Node.
RepositoryException - If an error occurs.
java.lang.Exception
java.util.List<Node> getNodes(java.lang.String namePattern)
throws java.lang.Exception
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 child nodes of
N that are either called 'myapp:report',
begin with the prefix 'jcr:' or are called 'my doc'.
Note that leading and trailing whitespace around a disjunct is
ignored, but whitespace within a disjunct forms part of the pattern to be
matched. The EBNF for namePattern is:
namePattern ::= disjunct {'|' disjunct}
disjunct ::= name [':' name]
name ::= '*' | ['*'] fragment {'*' fragment} ['*']
fragment ::= char {char}
char ::= nonspace | ' '
nonspace ::= (* Any Unicode character except: '/', ':', '[', ']', '*', ''', '"', '|'
or any whitespace character *)
The pattern is matched against the names (not the paths) of the
immediate child nodes of this node. If this node has no matching
child nodes, then an empty iterator is returned. The same
reacquisition semantics apply as with
getNode(String).
namePattern - a name pattern
NodeIterator
RepositoryException - If an unexpected error occurs.
java.lang.Exception
javax.jcr.Property getProperty(java.lang.String relPath)
throws java.lang.Exception
relPath relative to
this node. The same reacquisition semantics apply as with
getNode(String).
relPath - The relative path of the property to retrieve.
relPath.
PathNotFoundException - If no property exists at the specified path.
RepositoryException - If another error occurs.
java.lang.Exception
java.util.List<javax.jcr.Property> getProperties()
throws java.lang.Exception
PropertyIterator over all properties of this node. Does
not include child nodes of this node. The same
reacquisition semantics apply as with
getNode(String). If this node has no properties,
then an empty iterator is returned.
PropertyIterator.
RepositoryException - If an error occurs.
java.lang.Exception
java.util.List<javax.jcr.Property> getProperties(java.lang.String namePattern)
throws java.lang.Exception
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 properties of
N that are either called 'myapp:name',
begin with the prefix 'jcr:' or are called 'my doc'.
Note that leading and trailing whitespace around a disjunct is
ignored, but whitespace within a disjunct forms part of the pattern to be
matched. The EBNF for namePattern is:
namePattern ::= disjunct {'|' disjunct}
disjunct ::= name [':' name]
name ::= '*' | ['*'] fragment {'*' fragment} ['*']
fragment ::= char {char}
char ::= nonspace | ' '
nonspace ::= (* Any Unicode character except: '/', ':', '[', ']', '*', ''', '"', '|'
or any whitespace character *)
The pattern is matched against the names (not the paths) of the
immediate child properties of this node. If this node has no
matching properties, then an empty iterator is returned. The same
reacquisition semantics apply as with
getNode(String).
namePattern - a name pattern
PropertyIterator
RepositoryException - If an unexpected error occurs.
java.lang.Exception
Node getPrimaryItem()
throws java.lang.Exception
ItemNotFoundException. The same reacquisition semantics
apply as with getNode(String).
ItemNotFoundException - if this node does not have a primary child item, either
because none is declared in the node type or because a
declared primary item is not present on this node
instance.
RepositoryException - if another error occurs.
java.lang.Exception
java.lang.String getUUID()
throws java.lang.Exception
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("mix:referenceable") can be made.
UnsupportedRepositoryOperationException - If this node nonreferenceable.
RepositoryException - If another error occurs.
java.lang.Exception
int getIndex()
throws java.lang.Exception
/a[3]/b[4].
Note that the index always starts at 1 (not 0), for compatibility with
XPath. As a result, for nodes that do not have same-name-siblings, this
method will always return 1.
RepositoryException - if an error occurs.
java.lang.Exception
boolean hasNode(java.lang.String relPath)
throws java.lang.Exception
relPath Returns
true if a node exists at relPath and
false otherwise.
relPath - The path of a (possible) node.
true if a node exists at relPath;
false otherwise.
RepositoryException - If an unspecified error occurs.
java.lang.Exception
boolean hasProperty(java.lang.String relPath)
throws java.lang.Exception
relPath Returns
true if a property exists at relPath and
false otherwise.
relPath - The path of a (possible) property.
true if a property exists at relPath;
false otherwise.
RepositoryException - If an unspecified error occurs.
java.lang.Exception
boolean hasNodes()
throws java.lang.Exception
true
if this node has one or more child nodes; false otherwise.
true if this node has one or more child nodes;
false otherwise.
RepositoryException - If an unspecified error occurs.
java.lang.Exception
boolean hasProperties()
throws java.lang.Exception
true
if this node has one or more properties; false otherwise.
true if this node has one or more properties;
false otherwise.
RepositoryException - If an unspecified error occurs.
java.lang.Exception
java.lang.String getCorrespondingNodePath()
throws java.lang.Exception
this node. The corresponding node
is defined as the node in srcWorkspace with the same UUID
as this node or, if this node has no UUID, the same path relative to the
nearest ancestor that does have a UUID, or the root node,
whichever comes first. This is qualified by the requirment that
referencable nodes only correspond with other referencables and
non-referenceables with other non-referenceables. If no
corresponding node exists then an ItemNotFoundException is
thrown. If the specified workspace does not exist then a
NoSuchWorkspaceException is thrown. If the current
Session does not have sufficent rights to perform this
operation, an AccessDeniedException is thrown.
ItemNotFoundException - if no corresponding node is found.
NoSuchWorkspaceException - if the workspace is unknown.
AccessDeniedException - if the current session has insufficent
rights to perform this operation.
RepositoryException - if another error occurs.
java.lang.Exception
java.util.Date getCreated()
throws java.lang.Exception
RepositoryException - if an error occurs.
java.lang.Exception
java.lang.String getCreator()
throws java.lang.Exception
RepositoryException - if an error occurs.
java.lang.Exception
java.util.Date getModified()
throws java.lang.Exception
RepositoryException - if an error occurs.
java.lang.Exception
java.lang.String getModifier()
throws java.lang.Exception
RepositoryException - if an error occurs.
java.lang.Exception
java.util.Date getAccessed()
throws java.lang.Exception
RepositoryException - if an error occurs.
java.lang.Exception
java.lang.String getTitle()
throws java.lang.Exception
RepositoryException - if an error occurs.
java.lang.Exception
java.lang.String getDescription()
throws java.lang.Exception
RepositoryException - if an error occurs.
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||