org.apache.jackrabbit.core
Class PropertyImpl

java.lang.Object
  extended byorg.apache.jackrabbit.core.ItemImpl
      extended byorg.apache.jackrabbit.core.PropertyImpl
All Implemented Interfaces:
Item, ItemStateListener, Property

public class PropertyImpl
extends ItemImpl
implements Property

PropertyImpl implements the Property interface.


Field Summary
 
Fields inherited from class org.apache.jackrabbit.core.ItemImpl
id, itemMgr, listeners, rep, session, state, stateMgr, status, STATUS_DESTROYED, STATUS_INVALIDATED, STATUS_MODIFIED, STATUS_NORMAL
 
Method Summary
 void accept(ItemVisitor visitor)
          
protected  void checkSetValue(boolean multipleValues)
          Checks various pre-conditions that are common to all setValue() methods.
 boolean getBoolean()
          
 Calendar getDate()
          
 PropertyDefinition getDefinition()
          
 double getDouble()
          
 long getLength()
          
protected  long getLength(InternalValue value)
          Determines the length of the given value.
 long[] getLengths()
          
 long getLong()
          
 String getName()
          
 Node getNode()
          
protected  ItemState getOrCreateTransientItemState()
           
 Node getParent()
          
 QName getQName()
          Same as Item.getName() except that this method returns a QName instead of a String.
 InputStream getStream()
          
 String getString()
          
 int getType()
          
 Value getValue()
          
 Value[] getValues()
          
 InternalValue internalGetValue()
          Returns the internal values of this property
 InternalValue[] internalGetValues()
          Returns the internal values of this property
protected  void internalSetValue(InternalValue[] values, int type)
           
 boolean isNode()
          
protected  void makePersistent()
           
protected  void restoreTransient(PropertyState transientState)
           
 void setValue(boolean b)
          
 void setValue(Calendar date)
          
 void setValue(double number)
          
 void setValue(InputStream stream)
          
 void setValue(long number)
          
 void setValue(Node target)
          
 void setValue(QName name)
          Same as Property.setValue(String) except that this method takes a QName instead of a String value.
 void setValue(QName[] names)
          Same as Property.setValue(String[]) except that this method takes an array of QName instead of String values.
 void setValue(String string)
          
 void setValue(String[] strings)
          
 void setValue(Value value)
          
 void setValue(Value[] values)
          
 
Methods inherited from class org.apache.jackrabbit.core.ItemImpl
getAncestor, getDepth, getId, getPath, getPrimaryPath, getSession, internalRemove, isModified, isNew, isSame, isTransactionalNew, isTransient, notifyDestroyed, notifyInvalidated, refresh, remove, safeGetJCRPath, sanityCheck, save, setRemoved, stateCreated, stateDestroyed, stateDiscarded, stateModified
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.jcr.Item
getAncestor, getDepth, getPath, getSession, isModified, isNew, isSame, refresh, remove, save
 

Method Detail

getOrCreateTransientItemState

protected ItemState getOrCreateTransientItemState()
                                           throws RepositoryException
Specified by:
getOrCreateTransientItemState in class ItemImpl
Throws:
RepositoryException

makePersistent

protected void makePersistent()
                       throws InvalidItemStateException
Specified by:
makePersistent in class ItemImpl
Throws:
InvalidItemStateException

restoreTransient

protected void restoreTransient(PropertyState transientState)
                         throws RepositoryException
Throws:
RepositoryException

getLength

protected long getLength(InternalValue value)
                  throws RepositoryException
Determines the length of the given value.

Parameters:
value - value whose length should be determined
Returns:
the length of the given value
Throws:
RepositoryException - if an error occurs
See Also:
Property.getLength(), Property.getLengths()

checkSetValue

protected void checkSetValue(boolean multipleValues)
                      throws ValueFormatException,
                             VersionException,
                             LockException,
                             ConstraintViolationException,
                             RepositoryException
Checks various pre-conditions that are common to all setValue() methods. The checks performed are:

Parameters:
multipleValues - flag indicating whether the property is about to be set to an array of values
Throws:
ValueFormatException - if a single-valued property is set to an array of values (and vice versa)
VersionException - if the parent node is not checked-out
LockException - if the parent node is locked by somebody else
ConstraintViolationException - if the property is protected
RepositoryException - if another error occurs
See Also:
Property.setValue(javax.jcr.Value)

internalSetValue

protected void internalSetValue(InternalValue[] values,
                                int type)
                         throws ConstraintViolationException,
                                RepositoryException
Parameters:
values -
type -
Throws:
ConstraintViolationException
RepositoryException

setValue

public void setValue(QName name)
              throws ValueFormatException,
                     VersionException,
                     LockException,
                     ConstraintViolationException,
                     RepositoryException
Same as Property.setValue(String) except that this method takes a QName instead of a String value.

Parameters:
name -
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setValue

public void setValue(QName[] names)
              throws ValueFormatException,
                     VersionException,
                     LockException,
                     ConstraintViolationException,
                     RepositoryException
Same as Property.setValue(String[]) except that this method takes an array of QName instead of String values.

Parameters:
names -
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

getQName

public QName getQName()
Same as Item.getName() except that this method returns a QName instead of a String.

Specified by:
getQName in class ItemImpl
Returns:
the name of this item as QName

internalGetValues

public InternalValue[] internalGetValues()
                                  throws RepositoryException
Returns the internal values of this property

Returns:
Throws:
RepositoryException

internalGetValue

public InternalValue internalGetValue()
                               throws RepositoryException
Returns the internal values of this property

Returns:
Throws:
RepositoryException

getValues

public Value[] getValues()
                  throws ValueFormatException,
                         RepositoryException

Specified by:
getValues in interface Property
Throws:
ValueFormatException
RepositoryException

getValue

public Value getValue()
               throws ValueFormatException,
                      RepositoryException

Specified by:
getValue in interface Property
Throws:
ValueFormatException
RepositoryException

getString

public String getString()
                 throws ValueFormatException,
                        RepositoryException

Specified by:
getString in interface Property
Throws:
ValueFormatException
RepositoryException

getStream

public InputStream getStream()
                      throws ValueFormatException,
                             RepositoryException

Specified by:
getStream in interface Property
Throws:
ValueFormatException
RepositoryException

getLong

public long getLong()
             throws ValueFormatException,
                    RepositoryException

Specified by:
getLong in interface Property
Throws:
ValueFormatException
RepositoryException

getDouble

public double getDouble()
                 throws ValueFormatException,
                        RepositoryException

Specified by:
getDouble in interface Property
Throws:
ValueFormatException
RepositoryException

getDate

public Calendar getDate()
                 throws ValueFormatException,
                        RepositoryException

Specified by:
getDate in interface Property
Throws:
ValueFormatException
RepositoryException

getBoolean

public boolean getBoolean()
                   throws ValueFormatException,
                          RepositoryException

Specified by:
getBoolean in interface Property
Throws:
ValueFormatException
RepositoryException

getNode

public Node getNode()
             throws ValueFormatException,
                    RepositoryException

Specified by:
getNode in interface Property
Throws:
ValueFormatException
RepositoryException

setValue

public void setValue(Calendar date)
              throws ValueFormatException,
                     VersionException,
                     LockException,
                     ConstraintViolationException,
                     RepositoryException

Specified by:
setValue in interface Property
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setValue

public void setValue(double number)
              throws ValueFormatException,
                     VersionException,
                     LockException,
                     ConstraintViolationException,
                     RepositoryException

Specified by:
setValue in interface Property
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setValue

public void setValue(InputStream stream)
              throws ValueFormatException,
                     VersionException,
                     LockException,
                     ConstraintViolationException,
                     RepositoryException

Specified by:
setValue in interface Property
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setValue

public void setValue(String string)
              throws ValueFormatException,
                     VersionException,
                     LockException,
                     ConstraintViolationException,
                     RepositoryException

Specified by:
setValue in interface Property
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setValue

public void setValue(String[] strings)
              throws ValueFormatException,
                     VersionException,
                     LockException,
                     ConstraintViolationException,
                     RepositoryException

Specified by:
setValue in interface Property
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setValue

public void setValue(boolean b)
              throws ValueFormatException,
                     VersionException,
                     LockException,
                     ConstraintViolationException,
                     RepositoryException

Specified by:
setValue in interface Property
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setValue

public void setValue(Node target)
              throws ValueFormatException,
                     VersionException,
                     LockException,
                     ConstraintViolationException,
                     RepositoryException

Specified by:
setValue in interface Property
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setValue

public void setValue(long number)
              throws ValueFormatException,
                     VersionException,
                     LockException,
                     RepositoryException

Specified by:
setValue in interface Property
Throws:
ValueFormatException
VersionException
LockException
RepositoryException

setValue

public void setValue(Value value)
              throws ValueFormatException,
                     VersionException,
                     LockException,
                     ConstraintViolationException,
                     RepositoryException

Specified by:
setValue in interface Property
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setValue

public void setValue(Value[] values)
              throws ValueFormatException,
                     VersionException,
                     LockException,
                     ConstraintViolationException,
                     RepositoryException

Specified by:
setValue in interface Property
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

getLength

public long getLength()
               throws ValueFormatException,
                      RepositoryException

Specified by:
getLength in interface Property
Throws:
ValueFormatException
RepositoryException

getLengths

public long[] getLengths()
                  throws ValueFormatException,
                         RepositoryException

Specified by:
getLengths in interface Property
Throws:
ValueFormatException
RepositoryException

getDefinition

public PropertyDefinition getDefinition()
                                 throws RepositoryException

Specified by:
getDefinition in interface Property
Throws:
RepositoryException

getType

public int getType()
            throws RepositoryException

Specified by:
getType in interface Property
Throws:
RepositoryException

isNode

public boolean isNode()

Specified by:
isNode in interface Item
Specified by:
isNode in class ItemImpl

getName

public String getName()
               throws RepositoryException

Specified by:
getName in interface Item
Specified by:
getName in class ItemImpl
Throws:
RepositoryException

accept

public void accept(ItemVisitor visitor)
            throws RepositoryException

Specified by:
accept in interface Item
Specified by:
accept in class ItemImpl
Throws:
RepositoryException

getParent

public Node getParent()
               throws ItemNotFoundException,
                      AccessDeniedException,
                      RepositoryException

Specified by:
getParent in interface Item
Specified by:
getParent in class ItemImpl
Throws:
ItemNotFoundException
AccessDeniedException
RepositoryException


Copyright © 2004-2006 The Apache Software Foundation. All Rights Reserved.