org.priha.core
Class PropertyImpl

java.lang.Object
  extended by org.priha.core.ItemImpl
      extended by org.priha.core.PropertyImpl
All Implemented Interfaces:
java.lang.Comparable<PropertyImpl>, javax.jcr.Item, javax.jcr.Property

public class PropertyImpl
extends ItemImpl
implements javax.jcr.Property, java.lang.Comparable<PropertyImpl>


Field Summary
 
Fields inherited from class org.priha.core.ItemImpl
m_isNew, m_path, m_session
 
Constructor Summary
PropertyImpl(SessionImpl session, Path path, QPropertyDefinition propDef)
           
 
Method Summary
 int compareTo(PropertyImpl o)
           
 boolean equals(java.lang.Object obj)
          A PropertyImpl is equal to another PropertyImpl if Paths are equal Definitions are equal All values are equal (in case of a multi-valued object)
 boolean getBoolean()
           
 java.util.Calendar getDate()
           
 javax.jcr.nodetype.PropertyDefinition getDefinition()
           
 double getDouble()
           
 long getLength()
           
 long[] getLengths()
           
 long getLong()
           
 NodeImpl getNode()
           
 java.io.InputStream getStream()
           
 java.lang.String getString()
           
 int getType()
           
 ValueImpl getValue()
           
 ValueContainer getValueContainer()
           
 javax.jcr.Value[] getValues()
           
 boolean isTransient()
          Returns true, if this property is transient.
 void loadValue(javax.jcr.Value[] values, int propertyType)
          Differs from setValue() in the sense that it does not mark it modified.
 void loadValue(ValueImpl value)
          Differs from setValue(), as it does not mark the item modified.
protected  void preSave()
          Performs mandatory housekeeping right before saving.
 void remove()
          
 void save()
          
 void setDefinition(javax.jcr.nodetype.PropertyDefinition pd)
           
 void setTransient(boolean b)
          Transient properties are never saved - they just live within the Session.
 void setValue(boolean value)
           
 void setValue(java.util.Calendar value)
           
 void setValue(double value)
           
 void setValue(java.io.InputStream value)
           
 void setValue(long value)
           
 void setValue(javax.jcr.Node value)
           
 void setValue(java.lang.String value)
           
 void setValue(java.lang.String[] values)
           
 void setValue(java.lang.String value, int type)
           
 void setValue(javax.jcr.Value value)
           
 void setValue(javax.jcr.Value[] values)
           
 void setValue(javax.jcr.Value[] values, int propertyType)
           
 java.lang.String toString()
          Returns a human-readable description of the Item.
 
Methods inherited from class org.priha.core.ItemImpl
accept, enterState, getAncestor, getCreationTime, getDepth, getInternalPath, getName, getParent, getPath, getPathReference, getQName, getSession, getState, hashCode, isModified, isNew, isNode, isSame, postSave, refresh
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.jcr.Item
accept, getAncestor, getDepth, getName, getParent, getPath, getSession, isModified, isNew, isNode, isSame, refresh
 

Constructor Detail

PropertyImpl

public PropertyImpl(SessionImpl session,
                    Path path,
                    QPropertyDefinition propDef)
Method Detail

getBoolean

public boolean getBoolean()
                   throws javax.jcr.ValueFormatException,
                          javax.jcr.RepositoryException
Specified by:
getBoolean in interface javax.jcr.Property
Throws:
javax.jcr.ValueFormatException
javax.jcr.RepositoryException

getDate

public java.util.Calendar getDate()
                           throws javax.jcr.ValueFormatException,
                                  javax.jcr.RepositoryException
Specified by:
getDate in interface javax.jcr.Property
Throws:
javax.jcr.ValueFormatException
javax.jcr.RepositoryException

getDefinition

public javax.jcr.nodetype.PropertyDefinition getDefinition()
                                                    throws javax.jcr.RepositoryException
Specified by:
getDefinition in interface javax.jcr.Property
Throws:
javax.jcr.RepositoryException

getDouble

public double getDouble()
                 throws javax.jcr.ValueFormatException,
                        javax.jcr.RepositoryException
Specified by:
getDouble in interface javax.jcr.Property
Throws:
javax.jcr.ValueFormatException
javax.jcr.RepositoryException

getLength

public long getLength()
               throws javax.jcr.ValueFormatException,
                      javax.jcr.RepositoryException
Specified by:
getLength in interface javax.jcr.Property
Throws:
javax.jcr.ValueFormatException
javax.jcr.RepositoryException

getLengths

public long[] getLengths()
                  throws javax.jcr.ValueFormatException,
                         javax.jcr.RepositoryException
Specified by:
getLengths in interface javax.jcr.Property
Throws:
javax.jcr.ValueFormatException
javax.jcr.RepositoryException

getLong

public long getLong()
             throws javax.jcr.ValueFormatException,
                    javax.jcr.RepositoryException
Specified by:
getLong in interface javax.jcr.Property
Throws:
javax.jcr.ValueFormatException
javax.jcr.RepositoryException

getNode

public NodeImpl getNode()
                 throws javax.jcr.ValueFormatException,
                        javax.jcr.RepositoryException
Specified by:
getNode in interface javax.jcr.Property
Throws:
javax.jcr.ValueFormatException
javax.jcr.RepositoryException

getStream

public java.io.InputStream getStream()
                              throws javax.jcr.ValueFormatException,
                                     javax.jcr.RepositoryException
Specified by:
getStream in interface javax.jcr.Property
Throws:
javax.jcr.ValueFormatException
javax.jcr.RepositoryException

getString

public java.lang.String getString()
                           throws javax.jcr.ValueFormatException,
                                  javax.jcr.RepositoryException
Specified by:
getString in interface javax.jcr.Property
Throws:
javax.jcr.ValueFormatException
javax.jcr.RepositoryException

getType

public int getType()
            throws javax.jcr.RepositoryException
Specified by:
getType in interface javax.jcr.Property
Throws:
javax.jcr.RepositoryException

getValue

public ValueImpl getValue()
                   throws javax.jcr.ValueFormatException,
                          javax.jcr.RepositoryException
Specified by:
getValue in interface javax.jcr.Property
Throws:
javax.jcr.ValueFormatException
javax.jcr.RepositoryException

getValues

public javax.jcr.Value[] getValues()
                            throws javax.jcr.ValueFormatException,
                                   javax.jcr.RepositoryException
Specified by:
getValues in interface javax.jcr.Property
Throws:
javax.jcr.ValueFormatException
javax.jcr.RepositoryException

loadValue

public void loadValue(ValueImpl value)
               throws javax.jcr.version.VersionException,
                      javax.jcr.lock.LockException,
                      javax.jcr.nodetype.ConstraintViolationException,
                      javax.jcr.RepositoryException
Differs from setValue(), as it does not mark the item modified.

Parameters:
value -
Throws:
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException

setValue

public void setValue(javax.jcr.Value value)
              throws javax.jcr.ValueFormatException,
                     javax.jcr.version.VersionException,
                     javax.jcr.lock.LockException,
                     javax.jcr.nodetype.ConstraintViolationException,
                     javax.jcr.RepositoryException
Specified by:
setValue in interface javax.jcr.Property
Throws:
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException

setValue

public void setValue(javax.jcr.Value[] values)
              throws javax.jcr.ValueFormatException,
                     javax.jcr.version.VersionException,
                     javax.jcr.lock.LockException,
                     javax.jcr.nodetype.ConstraintViolationException,
                     javax.jcr.RepositoryException
Specified by:
setValue in interface javax.jcr.Property
Throws:
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException

setValue

public void setValue(javax.jcr.Value[] values,
                     int propertyType)
              throws javax.jcr.ValueFormatException,
                     javax.jcr.version.VersionException,
                     javax.jcr.lock.LockException,
                     javax.jcr.nodetype.ConstraintViolationException,
                     javax.jcr.RepositoryException
Throws:
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException

loadValue

public void loadValue(javax.jcr.Value[] values,
                      int propertyType)
               throws javax.jcr.ValueFormatException,
                      javax.jcr.version.VersionException,
                      javax.jcr.lock.LockException,
                      javax.jcr.nodetype.ConstraintViolationException,
                      javax.jcr.RepositoryException
Differs from setValue() in the sense that it does not mark it modified.

Parameters:
values -
Throws:
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException

setValue

public void setValue(java.lang.String value)
              throws javax.jcr.ValueFormatException,
                     javax.jcr.version.VersionException,
                     javax.jcr.lock.LockException,
                     javax.jcr.nodetype.ConstraintViolationException,
                     javax.jcr.RepositoryException
Specified by:
setValue in interface javax.jcr.Property
Throws:
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException

setValue

public void setValue(java.lang.String[] values)
              throws javax.jcr.ValueFormatException,
                     javax.jcr.version.VersionException,
                     javax.jcr.lock.LockException,
                     javax.jcr.nodetype.ConstraintViolationException,
                     javax.jcr.RepositoryException
Specified by:
setValue in interface javax.jcr.Property
Throws:
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException

setValue

public void setValue(java.io.InputStream value)
              throws javax.jcr.ValueFormatException,
                     javax.jcr.version.VersionException,
                     javax.jcr.lock.LockException,
                     javax.jcr.nodetype.ConstraintViolationException,
                     javax.jcr.RepositoryException
Specified by:
setValue in interface javax.jcr.Property
Throws:
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException

setValue

public void setValue(long value)
              throws javax.jcr.ValueFormatException,
                     javax.jcr.version.VersionException,
                     javax.jcr.lock.LockException,
                     javax.jcr.nodetype.ConstraintViolationException,
                     javax.jcr.RepositoryException
Specified by:
setValue in interface javax.jcr.Property
Throws:
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException

setValue

public void setValue(double value)
              throws javax.jcr.ValueFormatException,
                     javax.jcr.version.VersionException,
                     javax.jcr.lock.LockException,
                     javax.jcr.nodetype.ConstraintViolationException,
                     javax.jcr.RepositoryException
Specified by:
setValue in interface javax.jcr.Property
Throws:
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException

setValue

public void setValue(java.util.Calendar value)
              throws javax.jcr.ValueFormatException,
                     javax.jcr.version.VersionException,
                     javax.jcr.lock.LockException,
                     javax.jcr.nodetype.ConstraintViolationException,
                     javax.jcr.RepositoryException
Specified by:
setValue in interface javax.jcr.Property
Throws:
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException

setValue

public void setValue(boolean value)
              throws javax.jcr.ValueFormatException,
                     javax.jcr.version.VersionException,
                     javax.jcr.lock.LockException,
                     javax.jcr.nodetype.ConstraintViolationException,
                     javax.jcr.RepositoryException
Specified by:
setValue in interface javax.jcr.Property
Throws:
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException

setValue

public void setValue(javax.jcr.Node value)
              throws javax.jcr.ValueFormatException,
                     javax.jcr.version.VersionException,
                     javax.jcr.lock.LockException,
                     javax.jcr.nodetype.ConstraintViolationException,
                     javax.jcr.RepositoryException
Specified by:
setValue in interface javax.jcr.Property
Throws:
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException

setValue

public void setValue(java.lang.String value,
                     int type)
              throws javax.jcr.ValueFormatException,
                     javax.jcr.version.VersionException,
                     javax.jcr.lock.LockException,
                     javax.jcr.nodetype.ConstraintViolationException,
                     javax.jcr.RepositoryException
Throws:
javax.jcr.ValueFormatException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException

save

public void save()
          throws javax.jcr.AccessDeniedException,
                 javax.jcr.ItemExistsException,
                 javax.jcr.nodetype.ConstraintViolationException,
                 javax.jcr.InvalidItemStateException,
                 javax.jcr.ReferentialIntegrityException,
                 javax.jcr.version.VersionException,
                 javax.jcr.lock.LockException,
                 javax.jcr.nodetype.NoSuchNodeTypeException,
                 javax.jcr.RepositoryException
Description copied from class: ItemImpl

Specified by:
save in interface javax.jcr.Item
Specified by:
save in class ItemImpl
Throws:
javax.jcr.AccessDeniedException
javax.jcr.ItemExistsException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.InvalidItemStateException
javax.jcr.ReferentialIntegrityException
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.NoSuchNodeTypeException
javax.jcr.RepositoryException

toString

public java.lang.String toString()
Description copied from class: ItemImpl
Returns a human-readable description of the Item.

Overrides:
toString in class ItemImpl
Returns:
Something readable.

remove

public void remove()
            throws javax.jcr.version.VersionException,
                   javax.jcr.lock.LockException,
                   javax.jcr.nodetype.ConstraintViolationException,
                   javax.jcr.RepositoryException
Description copied from class: ItemImpl

Specified by:
remove in interface javax.jcr.Item
Specified by:
remove in class ItemImpl
Throws:
javax.jcr.version.VersionException
javax.jcr.lock.LockException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException

setDefinition

public void setDefinition(javax.jcr.nodetype.PropertyDefinition pd)

equals

public boolean equals(java.lang.Object obj)
A PropertyImpl is equal to another PropertyImpl if

Overrides:
equals in class java.lang.Object

compareTo

public int compareTo(PropertyImpl o)
Specified by:
compareTo in interface java.lang.Comparable<PropertyImpl>

setTransient

public void setTransient(boolean b)
Transient properties are never saved - they just live within the Session.

Parameters:
b - True, if you want to turn this property into a transient property.

isTransient

public boolean isTransient()
Returns true, if this property is transient.

Returns:
True or false.

preSave

protected void preSave()
                throws javax.jcr.RepositoryException
Description copied from class: ItemImpl
Performs mandatory housekeeping right before saving.

Overrides:
preSave in class ItemImpl
Throws:
javax.jcr.RepositoryException - If something goes wrong

getValueContainer

public ValueContainer getValueContainer()