|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface HierarchyManager
The HierarchyManager
interface ...
Method Summary | |
---|---|
int |
getDepth(ItemId id)
Returns the depth of the specified item which is equivalent to getPath(id).getAncestorCount() . |
Name |
getName(ItemId id)
Returns the name of the specified item. |
Name |
getName(NodeId id,
NodeId parentId)
Returns the name of the specified item, with the given parent id. |
Path |
getPath(ItemId id)
Returns the path to the given item. |
int |
getRelativeDepth(NodeId ancestorId,
ItemId descendantId)
Returns the depth of the specified descendant relative to the given ancestor. |
int |
getShareRelativeDepth(NodeId ancestorId,
ItemId descendantId)
Returns the depth of the specified share-descendant relative to the given share-ancestor. |
boolean |
isAncestor(NodeId nodeId,
ItemId itemId)
Determines whether the node with the specified nodeId
is an ancestor of the item denoted by the given itemId . |
boolean |
isShareAncestor(NodeId ancestor,
NodeId descendant)
Determines whether the node with the specified ancestor
is a share ancestor of the item denoted by the given descendant . |
NodeId |
resolveNodePath(Path path)
Resolves a path into a node id. |
ItemId |
resolvePath(Path path)
Deprecated. As of JSR 283, a Path doesn't anymore uniquely
identify an Item , therefore resolveNodePath(Path) and
resolvePropertyPath(Path) should be used instead. |
PropertyId |
resolvePropertyPath(Path path)
Resolves a path into a property id. |
Method Detail |
---|
ItemId resolvePath(Path path) throws RepositoryException
Path
doesn't anymore uniquely
identify an Item
, therefore resolveNodePath(Path)
and
resolvePropertyPath(Path)
should be used instead.
null
rather than throwing a PathNotFoundException
if there's no
item to be found at path
.
path
- path to resolve
path
or null
if there's no item at path
.
RepositoryException
- if an error occursNodeId resolveNodePath(Path path) throws RepositoryException
null
rather than throwing a PathNotFoundException
if there's no
node to be found at path
.
path
- path to resolve
path
or null
if there's no node at path
.
RepositoryException
- if an error occursPropertyId resolvePropertyPath(Path path) throws RepositoryException
null
rather than throwing a PathNotFoundException
if there's no
property to be found at path
.
path
- path to resolve
path
or null
if there's no property at path
.
RepositoryException
- if an error occursPath getPath(ItemId id) throws ItemNotFoundException, RepositoryException
id
-
ItemNotFoundException
RepositoryException
Name getName(ItemId id) throws ItemNotFoundException, RepositoryException
id
- id of item whose name should be returned
ItemNotFoundException
RepositoryException
Name getName(NodeId id, NodeId parentId) throws ItemNotFoundException, RepositoryException
getName(ItemId)
.
id
- node idparentId
- parent node id
ItemNotFoundException
RepositoryException
int getDepth(ItemId id) throws ItemNotFoundException, RepositoryException
getPath(id).getAncestorCount()
. The depth reflects the
absolute hierarchy level.
id
- item id
ItemNotFoundException
- if the specified id
does not
denote an existing item.
RepositoryException
- if another error occursint getRelativeDepth(NodeId ancestorId, ItemId descendantId) throws ItemNotFoundException, RepositoryException
ancestorId
and descendantId
denote the same item 0 is returned. If ancestorId
does not
denote an ancestor -1 is returned.
ancestorId
- ancestor iddescendantId
- descendant id
ancestorId
does not
denote an ancestor of the item denoted by descendantId
(or itself).
ItemNotFoundException
- if either of the specified id's does not
denote an existing item.
RepositoryException
- if another error occursboolean isAncestor(NodeId nodeId, ItemId itemId) throws ItemNotFoundException, RepositoryException
nodeId
is an ancestor of the item denoted by the given itemId
.
This is equivalent to
getPath(nodeId).isAncestorOf(getPath(itemId))
.
nodeId
- node iditemId
- item id
true
if the node with the specified
nodeId
is an ancestor of the item denoted by the
given itemId
false otherwise
ItemNotFoundException
- if any of the specified id's does not
denote an existing item.
RepositoryException
- if another error occursboolean isShareAncestor(NodeId ancestor, NodeId descendant) throws ItemNotFoundException, RepositoryException
ancestor
is a share ancestor of the item denoted by the given descendant
.
This is true
for two nodes A
, B
if either:
A
is a (proper) ancestor of B
N1
,...
,Nk
such that A
=
N1
and B
=Nk
and Ni
is the parent or a share-parent of
Ni+1
(for every i
in 1
...k-1
.
ancestor
- node iddescendant
- item id
true
if the node denoted by ancestor
is a share ancestor of the item denoted by descendant
,
false
otherwise
ItemNotFoundException
- if any of the specified id's does not
denote an existing item.
RepositoryException
- if another error occursint getShareRelativeDepth(NodeId ancestorId, ItemId descendantId) throws ItemNotFoundException, RepositoryException
ancestor
and descendant
denote the same item, 0
is returned. If ancestor
does not denote an share-ancestor -1
is returned.
ancestorId
- ancestor iddescendantId
- descendant id
-1
if ancestor
does
not denote a share-ancestor of the item denoted by descendant
(or itself).
ItemNotFoundException
- if either of the specified id's does not
denote an existing item.
RepositoryException
- if another error occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |