Class PropertyDelegate
- java.lang.Object
-
- org.apache.jackrabbit.oak.jcr.delegate.ItemDelegate
-
- org.apache.jackrabbit.oak.jcr.delegate.PropertyDelegate
-
public class PropertyDelegate extends ItemDelegate
PropertyDelegateserve as internal representations ofPropertys. Most methods of this class throw anInvalidItemStateExceptionexception if the instance is stale. An instance is stale if the underlying items does not exist anymore.
-
-
Field Summary
-
Fields inherited from class org.apache.jackrabbit.oak.jcr.delegate.ItemDelegate
sessionDelegate
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanexists()Determine whether the underlying item existsbooleangetBoolean()StringgetDate()@NotNull PropertyStategetMultiState()@NotNull StringgetName()Get the name of this item@Nullable NodeDelegategetParent()Get the parent of this item ornull.@NotNull StringgetPath()Get the path of this item@NotNull PropertyStategetPropertyState()@NotNull PropertyStategetSingleState()@Nullable Tree.StatusgetStatus()Get the status of this item.StringgetString()booleanisProtected()booleanremove()Remove the propertyvoidsetState(@NotNull PropertyState propertyState)StringtoString()protected voidupdate()The session has been updated since the last time this property delegate was accessed, so we need to re-retrieve the property state to get any potential updates.-
Methods inherited from class org.apache.jackrabbit.oak.jcr.delegate.ItemDelegate
checkAlive, checkUpdate, save
-
-
-
-
Method Detail
-
update
protected void update()
The session has been updated since the last time this property delegate was accessed, so we need to re-retrieve the property state to get any potential updates. It might also be that this property was removed, in which case thestatereference will benull.- Overrides:
updatein classItemDelegate
-
getName
@NotNull public @NotNull String getName()
Description copied from class:ItemDelegateGet the name of this item- Specified by:
getNamein classItemDelegate- Returns:
- oak name of this item
-
getPath
@NotNull public @NotNull String getPath()
Description copied from class:ItemDelegateGet the path of this item- Specified by:
getPathin classItemDelegate- Returns:
- oak path of this item
-
getParent
@Nullable public @Nullable NodeDelegate getParent()
Description copied from class:ItemDelegateGet the parent of this item ornull.- Specified by:
getParentin classItemDelegate- Returns:
- parent of this item or
nullfor root or if the parent is not accessible.
-
exists
public boolean exists()
Description copied from class:ItemDelegateDetermine whether the underlying item exists- Specified by:
existsin classItemDelegate- Returns:
truethe underlying tree exists,falseotherwise.
-
getStatus
@Nullable public @Nullable Tree.Status getStatus()
Description copied from class:ItemDelegateGet the status of this item.- Specified by:
getStatusin classItemDelegate- Returns:
Tree.Statusof this item ornullif not available.
-
isProtected
public boolean isProtected() throws InvalidItemStateException- Specified by:
isProtectedin classItemDelegate- Throws:
InvalidItemStateException
-
getPropertyState
@NotNull public @NotNull PropertyState getPropertyState() throws InvalidItemStateException
- Throws:
InvalidItemStateException
-
getSingleState
@NotNull public @NotNull PropertyState getSingleState() throws InvalidItemStateException, ValueFormatException
-
getBoolean
public boolean getBoolean() throws ValueFormatException, InvalidItemStateException
-
getString
public String getString() throws ValueFormatException, InvalidItemStateException
-
getDate
public String getDate() throws ValueFormatException, InvalidItemStateException
-
getMultiState
@NotNull public @NotNull PropertyState getMultiState() throws InvalidItemStateException, ValueFormatException
-
setState
public void setState(@NotNull @NotNull PropertyState propertyState)
-
remove
public boolean remove()
Remove the property- Specified by:
removein classItemDelegate- Returns:
trueif this item was removed; orfalseif this is the root node that can't be removed
-
-