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>

public class PropertyImpl
extends ItemImpl
implements 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()
           
 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()
           
 Value[] getValues()
           
 boolean isTransient()
          Returns true, if this property is transient.
 void loadValue(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(PropertyDefinition pd)
           
 void setTransient(boolean b)
          Transient properties are never saved - they just live within the Session.
 void setValue(Node value)
           
 void setValue(java.lang.String value, int type)
           
 void setValue(Value value)
           
 void setValue(Value[] values)
           
 void setValue(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
 

Constructor Detail

PropertyImpl

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

getBoolean

public boolean getBoolean()
                   throws ValueFormatException,
                          RepositoryException
Throws:
ValueFormatException
RepositoryException

getDate

public java.util.Calendar getDate()
                           throws ValueFormatException,
                                  RepositoryException
Throws:
ValueFormatException
RepositoryException

getDefinition

public PropertyDefinition getDefinition()
                                 throws RepositoryException
Throws:
RepositoryException

getDouble

public double getDouble()
                 throws ValueFormatException,
                        RepositoryException
Throws:
ValueFormatException
RepositoryException

getLength

public long getLength()
               throws ValueFormatException,
                      RepositoryException
Throws:
ValueFormatException
RepositoryException

getLengths

public long[] getLengths()
                  throws ValueFormatException,
                         RepositoryException
Throws:
ValueFormatException
RepositoryException

getLong

public long getLong()
             throws ValueFormatException,
                    RepositoryException
Throws:
ValueFormatException
RepositoryException

getNode

public NodeImpl getNode()
                 throws ValueFormatException,
                        RepositoryException
Throws:
ValueFormatException
RepositoryException

getStream

public java.io.InputStream getStream()
                              throws ValueFormatException,
                                     RepositoryException
Throws:
ValueFormatException
RepositoryException

getString

public java.lang.String getString()
                           throws ValueFormatException,
                                  RepositoryException
Throws:
ValueFormatException
RepositoryException

getType

public int getType()
            throws RepositoryException
Throws:
RepositoryException

getValue

public ValueImpl getValue()
                   throws ValueFormatException,
                          RepositoryException
Throws:
ValueFormatException
RepositoryException

getValues

public Value[] getValues()
                  throws ValueFormatException,
                         RepositoryException
Throws:
ValueFormatException
RepositoryException

loadValue

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

Parameters:
value -
Throws:
VersionException
LockException
ConstraintViolationException
RepositoryException

setValue

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

setValue

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

setValue

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

loadValue

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

Parameters:
values -
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setValue

public void setValue(Node value)
              throws ValueFormatException,
                     VersionException,
                     LockException,
                     ConstraintViolationException,
                     RepositoryException
Throws:
ValueFormatException
VersionException
LockException
ConstraintViolationException
RepositoryException

setValue

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

save

public void save()
          throws AccessDeniedException,
                 ItemExistsException,
                 ConstraintViolationException,
                 InvalidItemStateException,
                 ReferentialIntegrityException,
                 VersionException,
                 LockException,
                 NoSuchNodeTypeException,
                 RepositoryException
Description copied from class: ItemImpl

Specified by:
save in class ItemImpl
Throws:
AccessDeniedException
ItemExistsException
ConstraintViolationException
InvalidItemStateException
ReferentialIntegrityException
VersionException
LockException
NoSuchNodeTypeException
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 VersionException,
                   LockException,
                   ConstraintViolationException,
                   RepositoryException
Description copied from class: ItemImpl

Specified by:
remove in class ItemImpl
Throws:
VersionException
LockException
ConstraintViolationException
RepositoryException

setDefinition

public void setDefinition(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 RepositoryException
Description copied from class: ItemImpl
Performs mandatory housekeeping right before saving.

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

getValueContainer

public ValueContainer getValueContainer()