|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jackrabbit.core.ItemImpl
public abstract class ItemImpl
ItemImpl
implements the Item
interface.
Field Summary | |
---|---|
protected ItemData |
data
Item data associated with this item. |
protected ItemId |
id
|
protected ItemManager |
itemMgr
ItemManager that created this Item |
protected RepositoryImpl |
rep
the Repository object |
protected SessionImpl |
session
Session through which this Item was acquired |
protected SessionItemStateManager |
stateMgr
SessionItemStateManager associated with this Item |
protected static int |
STATUS_DESTROYED
|
protected static int |
STATUS_INVALIDATED
|
protected static int |
STATUS_MODIFIED
|
protected static int |
STATUS_NORMAL
|
Method Summary | |
---|---|
abstract void |
accept(javax.jcr.ItemVisitor visitor)
|
javax.jcr.Item |
getAncestor(int degree)
|
int |
getDepth()
|
ItemId |
getId()
Return the id of this Item . |
abstract String |
getName()
|
protected abstract ItemState |
getOrCreateTransientItemState()
|
abstract javax.jcr.Node |
getParent()
|
String |
getPath()
|
Path |
getPrimaryPath()
Returns the primary path to this Item . |
abstract Name |
getQName()
Same as except that
this method returns a Name instead of a
String . |
javax.jcr.Session |
getSession()
Returns the session associated with this item. |
protected void |
internalRemove(boolean noChecks)
Same as except for the
noChecks parameter. |
boolean |
isModified()
|
boolean |
isNew()
|
abstract boolean |
isNode()
|
boolean |
isSame(javax.jcr.Item otherItem)
|
protected boolean |
isTransactionalNew()
checks if this item is new. |
protected boolean |
isTransient()
|
protected abstract void |
makePersistent()
|
void |
refresh(boolean keepChanges)
|
void |
remove()
|
String |
safeGetJCRPath()
Failsafe mapping of internal id to JCR path for use in
diagnostic output, error messages etc. |
protected void |
sanityCheck()
Performs a sanity check on this item and the associated session. |
void |
save()
|
protected void |
setRemoved()
Marks this instance as 'removed' and notifies its listeners. |
String |
toString()
Returns the( safe ) path of this item for use
in diagnostic output. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final int STATUS_NORMAL
protected static final int STATUS_MODIFIED
protected static final int STATUS_DESTROYED
protected static final int STATUS_INVALIDATED
protected final ItemId id
protected final SessionImpl session
Session
through which this Item
was acquired
protected final RepositoryImpl rep
Repository
object
protected final ItemData data
protected final ItemManager itemMgr
ItemManager
that created this Item
protected final SessionItemStateManager stateMgr
SessionItemStateManager
associated with this Item
Method Detail |
---|
protected void sanityCheck() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
- if this item has been rendered invalid for some reasonprotected boolean isTransient()
protected abstract ItemState getOrCreateTransientItemState() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected abstract void makePersistent() throws javax.jcr.InvalidItemStateException
javax.jcr.InvalidItemStateException
protected void setRemoved() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
- if an error occurspublic ItemId getId()
Item
.
Item
public Path getPrimaryPath() throws javax.jcr.RepositoryException
Item
.
Item
javax.jcr.RepositoryException
public String safeGetJCRPath()
id
to JCR path for use in
diagnostic output, error messages etc.
protected void internalRemove(boolean noChecks) throws javax.jcr.version.VersionException, javax.jcr.lock.LockException, javax.jcr.nodetype.ConstraintViolationException, javax.jcr.RepositoryException
Item.remove()
except for the
noChecks
parameter.
noChecks
-
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.RepositoryException
javax.jcr.nodetype.ConstraintViolationException
public abstract Name getQName() throws javax.jcr.RepositoryException
Item.getName()
except that
this method returns a Name
instead of a
String
.
Name
javax.jcr.RepositoryException
- if an error occurs.public abstract void accept(javax.jcr.ItemVisitor visitor) throws javax.jcr.RepositoryException
accept
in interface javax.jcr.Item
javax.jcr.RepositoryException
public abstract boolean isNode()
isNode
in interface javax.jcr.Item
public abstract String getName() throws javax.jcr.RepositoryException
getName
in interface javax.jcr.Item
javax.jcr.RepositoryException
public abstract javax.jcr.Node 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 boolean isNew()
isNew
in interface javax.jcr.Item
protected boolean isTransactionalNew()
isNew()
but within a transaction an item can
be saved but not yet persisted.
public boolean isModified()
isModified
in interface javax.jcr.Item
public 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 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 void refresh(boolean keepChanges) throws javax.jcr.InvalidItemStateException, javax.jcr.RepositoryException
refresh
in interface javax.jcr.Item
javax.jcr.InvalidItemStateException
javax.jcr.RepositoryException
public javax.jcr.Item getAncestor(int degree) 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 String getPath() throws javax.jcr.RepositoryException
getPath
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 javax.jcr.Session getSession()
Since Jackrabbit 1.4 it is safe to use this method regardless of item state.
getSession
in interface javax.jcr.Item
http://issues.apache.org/jira/browse/JCR-911
public boolean isSame(javax.jcr.Item otherItem) throws javax.jcr.RepositoryException
isSame
in interface javax.jcr.Item
javax.jcr.RepositoryException
public String toString()
safe
) path of this item for use
in diagnostic output.
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |