public class ClientItem extends ClientObject implements 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(Session session,
RemoteItem remote,
LocalAdapterFactory factory)
Creates a local adapter for the given remote item.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(ItemVisitor visitor)
Accepts the visitor to visit this item.
|
Item |
getAncestor(int level) |
int |
getDepth() |
String |
getName() |
Node |
getParent() |
String |
getPath() |
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(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(Session session, RemoteItem remote, LocalAdapterFactory factory)
session
- current sessionremote
- remote itemfactory
- local adapter factorypublic Session getSession()
getSession
in interface Item
public String getPath() throws RepositoryException
getPath
in interface Item
RepositoryException
public String getName() throws RepositoryException
getName
in interface Item
RepositoryException
public Item getAncestor(int level) throws RepositoryException
getAncestor
in interface Item
RepositoryException
public Node getParent() throws RepositoryException
getParent
in interface Item
RepositoryException
public int getDepth() throws RepositoryException
getDepth
in interface Item
RepositoryException
public boolean isNode()
Node
subclasses.
public boolean isModified()
isModified
in interface Item
public boolean isSame(Item item) throws RepositoryException
isSame
in interface Item
RepositoryException
Item.getPath()
public void accept(ItemVisitor visitor) throws RepositoryException
Node
and
Property
subclasses should override this method
to call the appropriate ItemVisitor
methods,
as the default implementation does nothing.
accept
in interface Item
RepositoryException
public void save() throws RepositoryException
save
in interface Item
RepositoryException
public void refresh(boolean keepChanges) throws RepositoryException
refresh
in interface Item
RepositoryException
public void remove() throws RepositoryException
remove
in interface Item
RepositoryException
Copyright © 2004–2021 The Apache Software Foundation. All rights reserved.