|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jackrabbit.commons.AbstractItem
public abstract class AbstractItem
Abstract base class for implementing the JCR Item
interface.
Item
methods without a default implementation:
Item.accept(javax.jcr.ItemVisitor)
Item.getName()
Item.getParent()
Item.getPath()
Item.getSession()
Item.isModified()
Item.isNew()
Item.isNode()
Item.isSame(Item)
Item.refresh(boolean)
Item.remove()
Item.save()
Constructor Summary | |
---|---|
AbstractItem()
|
Method Summary | |
---|---|
Item |
getAncestor(int depth)
Returns the ancestor of this item at the given depth. |
int |
getDepth()
Returns the depth of this item. |
String |
toString()
Returns a string representation of this item. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface javax.jcr.Item |
---|
accept, getName, getParent, getPath, getSession, isModified, isNew, isNode, isSame, refresh, remove, save |
Constructor Detail |
---|
public AbstractItem()
Method Detail |
---|
public Item getAncestor(int depth) throws ItemNotFoundException, AccessDeniedException, RepositoryException
The default implementation handles the root node at depth zero and
this item at depth equal to the depth of this item as special cases,
and uses Session.getItem(String)
to retrieve other
ancestors based on the ancestor path calculated from the path of this
node as returned by Item.getPath()
.
getAncestor
in interface Item
depth
- depth of the returned ancestor item
ItemNotFoundException
- if the given depth is negative or greater
than the depth of this item
AccessDeniedException
- if access to the ancestor item is denied
RepositoryException
- if an error occurspublic int getDepth() throws RepositoryException
The default implementation determines the depth by counting the
slashes in the path returned by Item.getPath()
.
getDepth
in interface Item
RepositoryException
- if an error occurspublic String toString()
The default implementation returns the path of this item and falls
back to the Object.toString()
implementation if the item path
can not be retrieved.
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |