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, getNodeTypeArray
public 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.Item
public String getPath() throws javax.jcr.RepositoryException
getPath
in interface javax.jcr.Item
javax.jcr.RepositoryException
public String getName() throws javax.jcr.RepositoryException
getName
in interface javax.jcr.Item
javax.jcr.RepositoryException
public javax.jcr.Item getAncestor(int level) throws javax.jcr.RepositoryException
getAncestor
in interface javax.jcr.Item
javax.jcr.RepositoryException
public javax.jcr.Node getParent() throws javax.jcr.RepositoryException
getParent
in interface javax.jcr.Item
javax.jcr.RepositoryException
public int getDepth() throws javax.jcr.RepositoryException
getDepth
in interface javax.jcr.Item
javax.jcr.RepositoryException
public boolean isNode()
Node
subclasses.
isNode
in interface javax.jcr.Item
public boolean isNew()
isNew
in interface javax.jcr.Item
public boolean isModified()
isModified
in interface javax.jcr.Item
public boolean isSame(javax.jcr.Item item) throws javax.jcr.RepositoryException
isSame
in interface javax.jcr.Item
javax.jcr.RepositoryException
Item.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.Item
javax.jcr.RepositoryException
public void save() throws javax.jcr.RepositoryException
save
in interface javax.jcr.Item
javax.jcr.RepositoryException
public void refresh(boolean keepChanges) throws javax.jcr.RepositoryException
refresh
in interface javax.jcr.Item
javax.jcr.RepositoryException
public void remove() throws javax.jcr.RepositoryException
remove
in interface javax.jcr.Item
javax.jcr.RepositoryException
Copyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.