|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.priha.core.ItemImpl
public abstract class ItemImpl
Provides a basic implementation for Items. An Item stores a reference to its Path, the Session, and keeps a record of its ItemState. Therefore it's a fairly lightweight object.
Field Summary | |
---|---|
protected boolean |
m_isNew
|
protected PathRef |
m_path
|
protected SessionImpl |
m_session
|
Constructor Summary | |
---|---|
ItemImpl(SessionImpl session,
Path path)
Create an Item for a particular session and path. |
Method Summary | |
---|---|
void |
accept(javax.jcr.ItemVisitor visitor)
|
void |
enterState(ItemState state)
Changes the ItemState of the Item, and places it in the appropriate
queues. |
javax.jcr.Item |
getAncestor(int depth)
|
long |
getCreationTime()
Returns the creation time of this Item instance. |
int |
getDepth()
|
Path |
getInternalPath()
Get the internal path representation for this Item. |
java.lang.String |
getName()
|
NodeImpl |
getParent()
|
java.lang.String |
getPath()
|
PathRef |
getPathReference()
Returns the path reference object. |
QName |
getQName()
Returns the QName of this item. |
SessionImpl |
getSession()
|
ItemState |
getState()
Return the current state of this Item. |
int |
hashCode()
|
boolean |
isModified()
|
boolean |
isNew()
|
boolean |
isNode()
|
boolean |
isSame(javax.jcr.Item otherItem)
|
protected void |
postSave()
Performs mandatory housekeeping after item state has been persisted to disk. |
protected void |
preSave()
Performs mandatory housekeeping right before saving. |
void |
refresh(boolean keepChanges)
|
abstract void |
remove()
|
abstract void |
save()
|
java.lang.String |
toString()
Returns a human-readable description of the Item. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected PathRef m_path
protected final SessionImpl m_session
protected boolean m_isNew
Constructor Detail |
---|
public ItemImpl(SessionImpl session, Path path)
session
- Session which owns this Itempath
- Path at which the Item is created.Method Detail |
---|
public PathRef getPathReference()
public ItemState getState()
ItemState
representing the state.public void enterState(ItemState state) throws javax.jcr.RepositoryException
ItemState
of the Item, and places it in the appropriate
queues.
state
- New state.
javax.jcr.RepositoryException
- If the state cannot be entered for some reason.public void accept(javax.jcr.ItemVisitor visitor) throws javax.jcr.RepositoryException
accept
in interface javax.jcr.Item
javax.jcr.RepositoryException
public javax.jcr.Item getAncestor(int depth) throws javax.jcr.ItemNotFoundException, javax.jcr.AccessDeniedException, javax.jcr.RepositoryException
getAncestor
in interface javax.jcr.Item
javax.jcr.ItemNotFoundException
javax.jcr.AccessDeniedException
javax.jcr.RepositoryException
public int getDepth() throws javax.jcr.RepositoryException
getDepth
in interface javax.jcr.Item
javax.jcr.RepositoryException
public java.lang.String getName() throws javax.jcr.RepositoryException
getName
in interface javax.jcr.Item
javax.jcr.RepositoryException
public QName getQName() throws javax.jcr.NamespaceException, javax.jcr.RepositoryException
javax.jcr.NamespaceException
- If the namespace cannot be parsed.
javax.jcr.RepositoryException
- If something else goes wrong.public NodeImpl getParent() throws javax.jcr.ItemNotFoundException, javax.jcr.AccessDeniedException, javax.jcr.RepositoryException
getParent
in interface javax.jcr.Item
javax.jcr.ItemNotFoundException
javax.jcr.AccessDeniedException
javax.jcr.RepositoryException
public Path getInternalPath()
public java.lang.String getPath() throws javax.jcr.RepositoryException
getPath
in interface javax.jcr.Item
javax.jcr.RepositoryException
public SessionImpl getSession() throws javax.jcr.RepositoryException
getSession
in interface javax.jcr.Item
javax.jcr.RepositoryException
public boolean isModified()
isModified
in interface javax.jcr.Item
public boolean isNew()
isNew
in interface javax.jcr.Item
public boolean isNode()
isNode
in interface javax.jcr.Item
public boolean isSame(javax.jcr.Item otherItem) throws javax.jcr.RepositoryException
isSame
in interface javax.jcr.Item
javax.jcr.RepositoryException
public void refresh(boolean keepChanges) throws javax.jcr.InvalidItemStateException, javax.jcr.RepositoryException
refresh
in interface javax.jcr.Item
javax.jcr.InvalidItemStateException
javax.jcr.RepositoryException
public abstract void remove() throws javax.jcr.version.VersionException, javax.jcr.lock.LockException, javax.jcr.nodetype.ConstraintViolationException, javax.jcr.RepositoryException
remove
in interface javax.jcr.Item
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException
public abstract void save() throws javax.jcr.AccessDeniedException, javax.jcr.ItemExistsException, javax.jcr.nodetype.ConstraintViolationException, javax.jcr.InvalidItemStateException, javax.jcr.ReferentialIntegrityException, javax.jcr.version.VersionException, javax.jcr.lock.LockException, javax.jcr.nodetype.NoSuchNodeTypeException, javax.jcr.RepositoryException
save
in interface javax.jcr.Item
javax.jcr.AccessDeniedException
javax.jcr.ItemExistsException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.InvalidItemStateException
javax.jcr.ReferentialIntegrityException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.NoSuchNodeTypeException
javax.jcr.RepositoryException
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
protected void preSave() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
- If something goes wrongprotected void postSave()
public long getCreationTime()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |