Class PropertyDelegate
- java.lang.Object
-
- org.apache.jackrabbit.oak.jcr.delegate.ItemDelegate
-
- org.apache.jackrabbit.oak.jcr.delegate.PropertyDelegate
-
public class PropertyDelegate extends ItemDelegate
PropertyDelegate
serve as internal representations ofProperty
s. Most methods of this class throw anInvalidItemStateException
exception 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 boolean
exists()
Determine whether the underlying item existsboolean
getBoolean()
String
getDate()
@NotNull PropertyState
getMultiState()
@NotNull String
getName()
Get the name of this item@Nullable NodeDelegate
getParent()
Get the parent of this item ornull
.@NotNull String
getPath()
Get the path of this item@NotNull PropertyState
getPropertyState()
@NotNull PropertyState
getSingleState()
@Nullable Tree.Status
getStatus()
Get the status of this item.String
getString()
boolean
isProtected()
boolean
remove()
Remove the propertyvoid
setState(@NotNull PropertyState propertyState)
String
toString()
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.-
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 thestate
reference will benull
.- Overrides:
update
in classItemDelegate
-
getName
@NotNull public @NotNull String getName()
Description copied from class:ItemDelegate
Get the name of this item- Specified by:
getName
in classItemDelegate
- Returns:
- oak name of this item
-
getPath
@NotNull public @NotNull String getPath()
Description copied from class:ItemDelegate
Get the path of this item- Specified by:
getPath
in classItemDelegate
- Returns:
- oak path of this item
-
getParent
@Nullable public @Nullable NodeDelegate getParent()
Description copied from class:ItemDelegate
Get the parent of this item ornull
.- Specified by:
getParent
in classItemDelegate
- Returns:
- parent of this item or
null
for root or if the parent is not accessible.
-
exists
public boolean exists()
Description copied from class:ItemDelegate
Determine whether the underlying item exists- Specified by:
exists
in classItemDelegate
- Returns:
true
the underlying tree exists,false
otherwise.
-
getStatus
@Nullable public @Nullable Tree.Status getStatus()
Description copied from class:ItemDelegate
Get the status of this item.- Specified by:
getStatus
in classItemDelegate
- Returns:
Tree.Status
of this item ornull
if not available.
-
isProtected
public boolean isProtected() throws InvalidItemStateException
- Specified by:
isProtected
in 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:
remove
in classItemDelegate
- Returns:
true
if this item was removed; orfalse
if this is the root node that can't be removed
-
-