org.apache.jackrabbit.oak.jcr.delegate
Class PropertyDelegate

java.lang.Object
  extended by org.apache.jackrabbit.oak.jcr.delegate.ItemDelegate
      extended by org.apache.jackrabbit.oak.jcr.delegate.PropertyDelegate

public class PropertyDelegate
extends ItemDelegate

PropertyDelegate serve as internal representations of Propertys. Most methods of this class throw an InvalidItemStateException 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
 boolean exists()
          Determine whether the underlying item exists
 boolean getBoolean()
           
 String getDate()
           
 org.apache.jackrabbit.oak.api.PropertyState getMultiState()
           
 String getName()
          Get the name of this item
 NodeDelegate getParent()
          Get the parent of this item or null.
 String getPath()
          Get the path of this item
 org.apache.jackrabbit.oak.api.PropertyState getPropertyState()
           
 org.apache.jackrabbit.oak.api.PropertyState getSingleState()
           
 org.apache.jackrabbit.oak.api.Tree.Status getStatus()
          Get the status of this item.
 String getString()
           
 boolean isProtected()
           
 boolean remove()
          Remove the property
 void setState(org.apache.jackrabbit.oak.api.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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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 the state reference will be null.

Overrides:
update in class ItemDelegate

getName

@Nonnull
public String getName()
Description copied from class: ItemDelegate
Get the name of this item

Specified by:
getName in class ItemDelegate
Returns:
oak name of this item

getPath

@Nonnull
public String getPath()
Description copied from class: ItemDelegate
Get the path of this item

Specified by:
getPath in class ItemDelegate
Returns:
oak path of this item

getParent

@CheckForNull
public NodeDelegate getParent()
Description copied from class: ItemDelegate
Get the parent of this item or null.

Specified by:
getParent in class ItemDelegate
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 class ItemDelegate
Returns:
true the underlying tree exists, false otherwise.

getStatus

@CheckForNull
public org.apache.jackrabbit.oak.api.Tree.Status getStatus()
Description copied from class: ItemDelegate
Get the status of this item.

Specified by:
getStatus in class ItemDelegate
Returns:
Tree.Status of this item or null if not available.

isProtected

public boolean isProtected()
                    throws javax.jcr.InvalidItemStateException
Specified by:
isProtected in class ItemDelegate
Throws:
javax.jcr.InvalidItemStateException

getPropertyState

@Nonnull
public org.apache.jackrabbit.oak.api.PropertyState getPropertyState()
                                                             throws javax.jcr.InvalidItemStateException
Throws:
javax.jcr.InvalidItemStateException

getSingleState

@Nonnull
public org.apache.jackrabbit.oak.api.PropertyState getSingleState()
                                                           throws javax.jcr.InvalidItemStateException,
                                                                  javax.jcr.ValueFormatException
Throws:
javax.jcr.InvalidItemStateException
javax.jcr.ValueFormatException

getBoolean

public boolean getBoolean()
                   throws javax.jcr.ValueFormatException,
                          javax.jcr.InvalidItemStateException
Throws:
javax.jcr.ValueFormatException
javax.jcr.InvalidItemStateException

getString

public String getString()
                 throws javax.jcr.ValueFormatException,
                        javax.jcr.InvalidItemStateException
Throws:
javax.jcr.ValueFormatException
javax.jcr.InvalidItemStateException

getDate

public String getDate()
               throws javax.jcr.ValueFormatException,
                      javax.jcr.InvalidItemStateException
Throws:
javax.jcr.ValueFormatException
javax.jcr.InvalidItemStateException

getMultiState

@Nonnull
public org.apache.jackrabbit.oak.api.PropertyState getMultiState()
                                                          throws javax.jcr.InvalidItemStateException,
                                                                 javax.jcr.ValueFormatException
Throws:
javax.jcr.InvalidItemStateException
javax.jcr.ValueFormatException

setState

public void setState(org.apache.jackrabbit.oak.api.PropertyState propertyState)

remove

public boolean remove()
Remove the property

Specified by:
remove in class ItemDelegate
Returns:
true if this item was removed; or false if this is the root node that can't be removed

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012-2014 The Apache Software Foundation. All Rights Reserved.