|
||||||||||
| 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 SessionContext |
sessionContext
The component context of the session to which this item is associated. |
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(ItemVisitor visitor)
|
|
Item |
getAncestor(int degree)
|
|
int |
getDepth()
|
|
ItemId |
getId()
Return the id of this Item. |
|
abstract String |
getName()
|
|
protected abstract ItemState |
getOrCreateTransientItemState()
|
|
abstract Node |
getParent()
|
|
String |
getPath()
|
|
org.apache.jackrabbit.spi.Path |
getPrimaryPath()
Returns the primary path to this Item. |
|
abstract org.apache.jackrabbit.spi.Name |
getQName()
Same as except that
this method returns a Name instead of a
String. |
|
protected org.apache.jackrabbit.spi.Name |
getQName(String name)
Utility method that converts the given string into a qualified JCR name. |
|
Session |
getSession()
Returns the session associated with this item. |
|
protected int |
getType(Value[] values)
Utility method that returns the type of the first of the given values, or PropertyType.UNDEFINED when given no values. |
|
protected ValueFactory |
getValueFactory()
Utility method that returns the value factory of this session. |
|
protected Value[] |
getValues(String[] values,
int type)
Utility method that converts the given strings into JCR values of the given type |
|
boolean |
isModified()
|
|
boolean |
isNew()
|
|
abstract boolean |
isNode()
|
|
boolean |
isSame(Item otherItem)
|
|
protected boolean |
isTransactionalNew()
checks if this item is new. |
|
protected boolean |
isTransient()
|
|
protected void |
itemSanityCheck()
Checks the status of this item. |
|
protected abstract void |
makePersistent()
|
|
protected
|
perform(SessionOperation<T> operation)
|
|
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 SessionContext sessionContext
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 <T> T perform(SessionOperation<T> operation)
throws RepositoryException
RepositoryException
protected void sanityCheck()
throws RepositoryException
RepositoryException - if this item has been rendered invalid for some reason
protected void itemSanityCheck()
throws RepositoryException
RepositoryException - if this item no longer existsprotected boolean isTransient()
protected abstract ItemState getOrCreateTransientItemState()
throws RepositoryException
RepositoryException
protected abstract void makePersistent()
throws RepositoryException
RepositoryException
protected void setRemoved()
throws RepositoryException
RepositoryException - if an error occurspublic ItemId getId()
Item.
Item
public org.apache.jackrabbit.spi.Path getPrimaryPath()
throws RepositoryException
Item.
Item
RepositoryExceptionpublic String safeGetJCRPath()
id to JCR path for use in
diagnostic output, error messages etc.
public abstract org.apache.jackrabbit.spi.Name getQName()
throws RepositoryException
Item.getName() except that
this method returns a Name instead of a
String.
Name
RepositoryException - if an error occurs.
protected org.apache.jackrabbit.spi.Name getQName(String name)
throws RepositoryException
name - name string
RepositoryException - if the given name is invalid
protected ValueFactory getValueFactory()
throws RepositoryException
RepositoryException - if the value factory is not available
protected Value[] getValues(String[] values,
int type)
throws RepositoryException
values - value stringstype - value type
RepositoryException - if the values can not be convertedprotected int getType(Value[] values)
PropertyType.UNDEFINED when given no values.
values - given values, or null
PropertyType.UNDEFINED
public abstract void accept(ItemVisitor visitor)
throws RepositoryException
accept in interface ItemRepositoryExceptionpublic abstract boolean isNode()
isNode in interface Item
public abstract String getName()
throws RepositoryException
getName in interface ItemRepositoryException
public abstract Node getParent()
throws ItemNotFoundException,
AccessDeniedException,
RepositoryException
getParent in interface ItemItemNotFoundException
AccessDeniedException
RepositoryExceptionpublic boolean isNew()
isNew in interface Itemprotected boolean isTransactionalNew()
isNew() but within a transaction an item can
be saved but not yet persisted.
public boolean isModified()
isModified in interface Item
public void remove()
throws RepositoryException
remove in interface ItemRepositoryException
public void save()
throws RepositoryException
save in interface ItemRepositoryException
public void refresh(boolean keepChanges)
throws RepositoryException
refresh in interface ItemRepositoryException
public Item getAncestor(int degree)
throws RepositoryException
getAncestor in interface ItemRepositoryException
public String getPath()
throws RepositoryException
getPath in interface ItemRepositoryException
public int getDepth()
throws RepositoryException
getDepth in interface ItemRepositoryExceptionpublic Session getSession()
Since Jackrabbit 1.4 it is safe to use this method regardless of item state.
getSession in interface Item
public boolean isSame(Item otherItem)
throws RepositoryException
isSame in interface ItemRepositoryExceptionpublic 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 | |||||||||