org.apache.jackrabbit.webdav.property
Class HrefProperty

java.lang.Object
  extended byorg.apache.jackrabbit.webdav.property.AbstractDavProperty
      extended byorg.apache.jackrabbit.webdav.property.HrefProperty
All Implemented Interfaces:
DavConstants, DavProperty, XmlSerializable
Direct Known Subclasses:
OrderingType

public class HrefProperty
extends AbstractDavProperty

HrefProperty is an extension to the common DavProperty. The String representation of the property value is always displayed as text inside an extra 'href' element. If the value is a String array each array element is added as text to a separate 'href' element.

See Also:
DavConstants.XML_HREF, DavProperty.getValue()

Field Summary
 
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
HrefProperty(DavProperty prop)
          Create a new HrefProperty from the specified property.
HrefProperty(DavPropertyName name, String[] value, boolean isProtected)
          Creates a new WebDAV property with the given DavPropertyName
HrefProperty(DavPropertyName name, String value, boolean isProtected)
          Creates a new WebDAV property with the given DavPropertyName
 
Method Summary
 List getHrefs()
          Return an array of String containg the text of those DAV:href elements that would be returned as child elements of this property on XmlSerializable.toXml(Document)
 Object getValue()
          Returns an array of String.
 Element toXml(Document document)
          Returns an Xml element with the following form:
 
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

HrefProperty

public HrefProperty(DavPropertyName name,
                    String value,
                    boolean isProtected)
Creates a new WebDAV property with the given DavPropertyName

Parameters:
name - the name of the property
value - the value of the property
isProtected - A value of true, defines this property to be protected. It will not be returned in a DAV:allprop PROPFIND request and cannot be set/removed with a PROPPATCH request.

HrefProperty

public HrefProperty(DavPropertyName name,
                    String[] value,
                    boolean isProtected)
Creates a new WebDAV property with the given DavPropertyName

Parameters:
name - the name of the property
value - the value of the property
isProtected - A value of true, defines this property to be protected. It will not be returned in a DAV:allprop PROPFIND request and cannot be set/removed with a PROPPATCH request.

HrefProperty

public HrefProperty(DavProperty prop)
Create a new HrefProperty from the specified property. Please note, that the property must have a List value object, consisting of href Element entries.

Parameters:
prop -
Throws:
IllegalArgumentException - if the property value is not a List.
Method Detail

toXml

public Element toXml(Document document)
Returns an Xml element with the following form:
 <Z:name>
    <DAV:href>value</DAV:href/>
 </Z:name>
 
where Z: represents the prefix of the namespace defined with the initial webdav property name.

Specified by:
toXml in interface XmlSerializable
Overrides:
toXml in class AbstractDavProperty
Parameters:
document -
Returns:
Xml representation
See Also:
DomUtil.hrefToXml(String,org.w3c.dom.Document)

getValue

public Object getValue()
Returns an array of String.

Returns:
an array of String.
See Also:
DavProperty.getValue()

getHrefs

public List getHrefs()
Return an array of String containg the text of those DAV:href elements that would be returned as child elements of this property on XmlSerializable.toXml(Document)

Returns:
array of href String


Copyright © 2005-2006 . All Rights Reserved.