public class ClientItem extends ClientObject implements javax.jcr.Item
RemoteItem
interface. This class makes a remote item locally available using
the JCR Item interface. Used mainly as the
base class for the
ClientProperty
and
ClientNode adapters.Item,
RemoteItem| Constructor and Description |
|---|
ClientItem(javax.jcr.Session session,
RemoteItem remote,
LocalAdapterFactory factory)
Creates a local adapter for the given remote item.
|
| Modifier and Type | Method and Description |
|---|---|
void |
accept(javax.jcr.ItemVisitor visitor)
Accepts the visitor to visit this item.
|
javax.jcr.Item |
getAncestor(int level) |
int |
getDepth() |
String |
getName() |
javax.jcr.Node |
getParent() |
String |
getPath() |
javax.jcr.Session |
getSession()
Returns the current session without contacting the remote item.
|
boolean |
isModified() |
boolean |
isNew() |
boolean |
isNode()
Returns false by default without contacting the remote item.
|
boolean |
isSame(javax.jcr.Item item)
Checks whether this instance represents the same repository item as
the given other instance.
|
void |
refresh(boolean keepChanges) |
void |
remove() |
void |
save() |
getFactory, getItem, getNode, getNodeTypeArraypublic ClientItem(javax.jcr.Session session,
RemoteItem remote,
LocalAdapterFactory factory)
session - current sessionremote - remote itemfactory - local adapter factorypublic javax.jcr.Session getSession()
getSession in interface javax.jcr.Itempublic String getPath() throws javax.jcr.RepositoryException
getPath in interface javax.jcr.Itemjavax.jcr.RepositoryExceptionpublic String getName() throws javax.jcr.RepositoryException
getName in interface javax.jcr.Itemjavax.jcr.RepositoryExceptionpublic javax.jcr.Item getAncestor(int level)
throws javax.jcr.RepositoryException
getAncestor in interface javax.jcr.Itemjavax.jcr.RepositoryExceptionpublic javax.jcr.Node getParent()
throws javax.jcr.RepositoryException
getParent in interface javax.jcr.Itemjavax.jcr.RepositoryExceptionpublic int getDepth()
throws javax.jcr.RepositoryException
getDepth in interface javax.jcr.Itemjavax.jcr.RepositoryExceptionpublic boolean isNode()
Node subclasses.
isNode in interface javax.jcr.Itempublic boolean isNew()
isNew in interface javax.jcr.Itempublic boolean isModified()
isModified in interface javax.jcr.Itempublic boolean isSame(javax.jcr.Item item)
throws javax.jcr.RepositoryException
isSame in interface javax.jcr.Itemjavax.jcr.RepositoryExceptionItem.getPath()public void accept(javax.jcr.ItemVisitor visitor)
throws javax.jcr.RepositoryException
Node and
Property subclasses should override this method
to call the appropriate ItemVisitor methods,
as the default implementation does nothing.
accept in interface javax.jcr.Itemjavax.jcr.RepositoryExceptionpublic void save()
throws javax.jcr.RepositoryException
save in interface javax.jcr.Itemjavax.jcr.RepositoryExceptionpublic void refresh(boolean keepChanges)
throws javax.jcr.RepositoryException
refresh in interface javax.jcr.Itemjavax.jcr.RepositoryExceptionpublic void remove()
throws javax.jcr.RepositoryException
remove in interface javax.jcr.Itemjavax.jcr.RepositoryExceptionCopyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.