org.alfresco.jcr.item
Class PropertyImpl

java.lang.Object
  extended by org.alfresco.jcr.item.ItemImpl
      extended by org.alfresco.jcr.item.PropertyImpl
All Implemented Interfaces:
javax.jcr.Item, javax.jcr.Property
Direct Known Subclasses:
JCRLockIsDeepProperty, JCRLockOwnerProperty, JCRMixinTypesProperty, JCRPrimaryTypeProperty, JCRUUIDProperty

public class PropertyImpl
extends ItemImpl
implements javax.jcr.Property

Alfresco implementation of a Property


Field Summary
 
Fields inherited from class org.alfresco.jcr.item.ItemImpl
session
 
Constructor Summary
PropertyImpl(NodeImpl node, org.alfresco.service.namespace.QName name)
          Constructor
 
Method Summary
 void accept(javax.jcr.ItemVisitor visitor)
           
 boolean equals(java.lang.Object obj)
           
 javax.jcr.Item getAncestor(int depth)
           
 boolean getBoolean()
           
 java.util.Calendar getDate()
           
 javax.jcr.nodetype.PropertyDefinition getDefinition()
           
 int getDepth()
           
 double getDouble()
           
 long getLength()
           
 long[] getLengths()
           
 long getLong()
           
 java.lang.String getName()
           
 javax.jcr.Node getNode()
           
protected  NodeImpl getNodeImpl()
          Gets the Node Implementation that contains this property
 javax.jcr.Node getParent()
           
 java.lang.String getPath()
           
protected  org.alfresco.service.namespace.QName getPropertyName()
          Gets the Property Name
protected  java.lang.Object getPropertyValue()
          Gets the property value
 javax.jcr.Property getProxy()
          Create proxied JCR Property
 java.io.InputStream getStream()
           
 java.lang.String getString()
           
 int getType()
           
 javax.jcr.Value getValue()
           
 javax.jcr.Value[] getValues()
           
 int hashCode()
           
 boolean isNode()
           
 boolean isSame(javax.jcr.Item otherItem)
           
 void remove()
           
protected  void setPropertyValue(java.lang.Object[] values, int type)
          Sets a property value
protected  void setPropertyValue(java.lang.Object value, int type)
          Sets a property value
 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(javax.jcr.Value value)
           
 void setValue(javax.jcr.Value[] values)
           
 
Methods inherited from class org.alfresco.jcr.item.ItemImpl
getSession, getSessionImpl, isModified, isNew, refresh, save
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.jcr.Item
getSession, isModified, isNew, refresh, save
 

Constructor Detail

PropertyImpl

public PropertyImpl(NodeImpl node,
                    org.alfresco.service.namespace.QName name)
Constructor

Parameters:
session -
Method Detail

getProxy

public javax.jcr.Property getProxy()
Create proxied JCR Property

Specified by:
getProxy in class ItemImpl
Returns:
property

remove

public void remove()
            throws javax.jcr.version.VersionException,
                   javax.jcr.lock.LockException,
                   javax.jcr.nodetype.ConstraintViolationException,
                   javax.jcr.RepositoryException
Specified by:
remove in interface javax.jcr.Item
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(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

getValue

public javax.jcr.Value 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

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

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

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

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

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

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

getNode

public javax.jcr.Node getNode()
                       throws javax.jcr.ValueFormatException,
                              javax.jcr.RepositoryException
Specified by:
getNode 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

getDefinition

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

getType

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

getName

public java.lang.String getName()
                         throws javax.jcr.RepositoryException
Specified by:
getName in interface javax.jcr.Item
Throws:
javax.jcr.RepositoryException

isNode

public boolean isNode()
Specified by:
isNode in interface javax.jcr.Item

getParent

public javax.jcr.Node getParent()
                         throws javax.jcr.ItemNotFoundException,
                                javax.jcr.AccessDeniedException,
                                javax.jcr.RepositoryException
Specified by:
getParent in interface javax.jcr.Item
Throws:
javax.jcr.ItemNotFoundException
javax.jcr.AccessDeniedException
javax.jcr.RepositoryException

getPath

public java.lang.String getPath()
                         throws javax.jcr.RepositoryException
Specified by:
getPath in interface javax.jcr.Item
Throws:
javax.jcr.RepositoryException

getDepth

public int getDepth()
             throws javax.jcr.RepositoryException
Specified by:
getDepth in interface javax.jcr.Item
Throws:
javax.jcr.RepositoryException

getAncestor

public javax.jcr.Item getAncestor(int depth)
                           throws javax.jcr.ItemNotFoundException,
                                  javax.jcr.AccessDeniedException,
                                  javax.jcr.RepositoryException
Specified by:
getAncestor in interface javax.jcr.Item
Throws:
javax.jcr.ItemNotFoundException
javax.jcr.AccessDeniedException
javax.jcr.RepositoryException

isSame

public boolean isSame(javax.jcr.Item otherItem)
               throws javax.jcr.RepositoryException
Specified by:
isSame in interface javax.jcr.Item
Throws:
javax.jcr.RepositoryException

accept

public void accept(javax.jcr.ItemVisitor visitor)
            throws javax.jcr.RepositoryException
Specified by:
accept in interface javax.jcr.Item
Throws:
javax.jcr.RepositoryException

getNodeImpl

protected NodeImpl getNodeImpl()
Gets the Node Implementation that contains this property

Returns:
the node implementation

getPropertyName

protected org.alfresco.service.namespace.QName getPropertyName()
Gets the Property Name

Returns:
the property name

getPropertyValue

protected java.lang.Object getPropertyValue()
                                     throws javax.jcr.RepositoryException
Gets the property value

Returns:
the property value
Throws:
javax.jcr.RepositoryException

setPropertyValue

protected void setPropertyValue(java.lang.Object value,
                                int type)
                         throws javax.jcr.RepositoryException
Sets a property value

Parameters:
value - the value to set
type - type to explicitly convert to or -1 to convert to property type
Throws:
javax.jcr.RepositoryException

setPropertyValue

protected void setPropertyValue(java.lang.Object[] values,
                                int type)
                         throws javax.jcr.RepositoryException
Sets a property value

Parameters:
values - the values to set
type - type to explicitly convert to or -1 to convert to property type
Throws:
javax.jcr.RepositoryException

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.