org.apache.jackrabbit.webdav.jcr.property
Class ValuesProperty

java.lang.Object
  extended byorg.apache.jackrabbit.webdav.property.AbstractDavProperty
      extended byorg.apache.jackrabbit.webdav.jcr.property.ValuesProperty
All Implemented Interfaces:
org.apache.jackrabbit.webdav.DavConstants, org.apache.jackrabbit.webdav.property.DavProperty, ItemResourceConstants, org.apache.jackrabbit.webdav.xml.XmlSerializable

public class ValuesProperty
extends org.apache.jackrabbit.webdav.property.AbstractDavProperty
implements ItemResourceConstants

ValuesProperty extends DavProperty providing utilities to handle the multiple values of the property item represented by this resource.


Field Summary
 
Fields inherited from interface org.apache.jackrabbit.webdav.jcr.ItemResourceConstants
ATTR_VALUE_TYPE, COMPLIANCE_CLASS, EXCLUSIVE_SESSION, JCR_DEFINITION, JCR_DEPTH, JCR_INDEX, JCR_ISMODIFIED, JCR_ISNEW, JCR_LENGTH, JCR_LENGTHS, JCR_MIXINNODETYPES, JCR_NAME, JCR_NAMESPACES, JCR_PARENT, JCR_PATH, JCR_PRIMARYITEM, JCR_PRIMARYNODETYPE, JCR_REFERENCES, JCR_TYPE, JCR_UUID, JCR_VALUE, JCR_VALUES, JCR_VERSIONABLEUUID, METHODS, NAMESPACE, ROOT_ITEM_PATH, VERSIONSTORAGE_PATH, XML_DESCRIPTOR, XML_DESCRIPTORKEY, XML_DESCRIPTORVALUE, XML_EXCLUSIVE_SESSION_SCOPED, XML_LENGTH, XML_NAMESPACE, XML_PREFIX, XML_PRIMARYNODETYPE, XML_RELPATH, XML_REMOVEEXISTING, XML_URI, XML_VALUE
 
Fields inherited from interface org.apache.jackrabbit.webdav.DavConstants
creationDateFormat, DEPTH_0, DEPTH_1, DEPTH_INFINITY, DEPTH_INFINITY_S, HEADER_AUTHORIZATION, HEADER_CONTENT_LANGUAGE, HEADER_CONTENT_LENGTH, HEADER_CONTENT_TYPE, HEADER_DAV, HEADER_DEPTH, HEADER_DESTINATION, HEADER_ETAG, HEADER_IF, HEADER_LAST_MODIFIED, HEADER_LOCK_TOKEN, HEADER_OVERWRITE, HEADER_TIMEOUT, INFINITE_TIMEOUT, modificationDateFormat, NAMESPACE, OPAQUE_LOCK_TOKEN_PREFIX, PROPERTY_CREATIONDATE, PROPERTY_DISPLAYNAME, PROPERTY_GETCONTENTLANGUAGE, PROPERTY_GETCONTENTLENGTH, PROPERTY_GETCONTENTTYPE, PROPERTY_GETETAG, PROPERTY_GETLASTMODIFIED, PROPERTY_LOCKDISCOVERY, PROPERTY_RESOURCETYPE, PROPERTY_SOURCE, PROPERTY_SUPPORTEDLOCK, PROPFIND_ALL_PROP, PROPFIND_BY_PROPERTY, PROPFIND_PROPERTY_NAMES, TIMEOUT_INFINITE, UNDEFINED_TIMEOUT, XML_ACTIVELOCK, XML_ALLPROP, XML_COLLECTION, XML_DEPTH, XML_DST, XML_EXCLUSIVE, XML_HREF, XML_KEEPALIVE, XML_LINK, XML_LOCKENTRY, XML_LOCKINFO, XML_LOCKSCOPE, XML_LOCKTOKEN, XML_LOCKTYPE, XML_MULTISTATUS, XML_OMIT, XML_OWNER, XML_PROP, XML_PROPERTYBEHAVIOR, XML_PROPERTYUPDATE, XML_PROPFIND, XML_PROPNAME, XML_PROPSTAT, XML_REMOVE, XML_RESPONSE, XML_RESPONSEDESCRIPTION, XML_SET, XML_SHARED, XML_SOURCE, XML_STATUS, XML_TIMEOUT, XML_WRITE
 
Constructor Summary
ValuesProperty(org.apache.jackrabbit.webdav.property.DavProperty property, int defaultType)
          Wrap the specified DavProperty in a new ValuesProperty.
ValuesProperty(Value value)
          Create a new ValuesProperty from the given single Value.
ValuesProperty(Value[] values)
          Create a new ValuesProperty from the given Value array.
 
Method Summary
 Value getJcrValue()
           
 Value getJcrValue(int propertyType)
           
 Value[] getJcrValues()
          Returns the internal property value as jcr Value array
 Value[] getJcrValues(int propertyType)
          Converts the value of this property to a value array.
 Object getValue()
          Returns an array of Values representing the value of this property.
 int getValueType()
          Returns the type of the values present in this property or PropertyType.UNDEFINED if no values are available.
 Element toXml(Document document)
           
 
Methods inherited from class org.apache.jackrabbit.webdav.property.AbstractDavProperty
equals, getName, hashCode, isProtected
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValuesProperty

public ValuesProperty(Value value)
Create a new ValuesProperty from the given single Value.

Parameters:
value - Array of Value objects as obtained from the JCR property.

ValuesProperty

public ValuesProperty(Value[] values)
Create a new ValuesProperty from the given Value array.

Parameters:
values - Array of Value objects as obtained from the JCR property.

ValuesProperty

public ValuesProperty(org.apache.jackrabbit.webdav.property.DavProperty property,
                      int defaultType)
               throws RepositoryException,
                      org.apache.jackrabbit.webdav.DavException
Wrap the specified DavProperty in a new ValuesProperty.

Parameters:
property -
defaultType - default type of the values to be deserialized. If however the 'value' elements provide a 'type' attribute, the default value is ignored.
Method Detail

getJcrValues

public Value[] getJcrValues(int propertyType)
                     throws ValueFormatException
Converts the value of this property to a value array.

Returns:
Array of Value objects
Throws:
ValueFormatException - if convertion of the internal jcr values to the specified value type fails.

getJcrValues

public Value[] getJcrValues()
                     throws ValueFormatException
Returns the internal property value as jcr Value array

Returns:
Throws:
ValueFormatException

getJcrValue

public Value getJcrValue(int propertyType)
                  throws ValueFormatException
Parameters:
propertyType -
Returns:
Throws:
ValueFormatException

getJcrValue

public Value getJcrValue()
                  throws ValueFormatException
Returns:
Throws:
ValueFormatException

getValueType

public int getValueType()
Returns the type of the values present in this property or PropertyType.UNDEFINED if no values are available.

Returns:
type of values or PropertyType.UNDEFINED

getValue

public Object getValue()
Returns an array of Values representing the value of this property.

Specified by:
getValue in interface org.apache.jackrabbit.webdav.property.DavProperty
Returns:
an array of Values
See Also:
getJcrValues(int)

toXml

public Element toXml(Document document)
Specified by:
toXml in interface org.apache.jackrabbit.webdav.xml.XmlSerializable
Parameters:
document -
Returns:


Copyright © 2005-2006 . All Rights Reserved.