org.apache.jackrabbit.webdav.property
Class HrefProperty

java.lang.Object
  extended by org.apache.jackrabbit.webdav.property.AbstractDavProperty<String[]>
      extended by org.apache.jackrabbit.webdav.property.HrefProperty
All Implemented Interfaces:
DavConstants, DavProperty<String[]>, PropEntry, XmlSerializable
Direct Known Subclasses:
OrderingType

public class HrefProperty
extends AbstractDavProperty<String[]>

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_ALL_PROP_INCLUDE, PROPFIND_BY_PROPERTY, PROPFIND_PROPERTY_NAMES, TIMEOUT_INFINITE, UNDEFINED_TIME, UNDEFINED_TIMEOUT, XML_ACTIVELOCK, XML_ALLPROP, XML_COLLECTION, XML_DEPTH, XML_DST, XML_EXCLUSIVE, XML_HREF, XML_INCLUDE, XML_KEEPALIVE, XML_LINK, XML_LOCKENTRY, XML_LOCKINFO, XML_LOCKROOT, 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 isInvisibleInAllprop)
          Creates a new WebDAV property with the given DavPropertyName
HrefProperty(DavPropertyName name, String value, boolean isInvisibleInAllprop)
          Creates a new WebDAV property with the given DavPropertyName
 
Method Summary
 List<String> getHrefs()
          Return an list of String containing the text of those DAV:href elements that would be returned as child elements of this property on XmlSerializable.toXml(Document)
 String[] getValue()
          Returns an array of String.
 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.
 
Methods inherited from class org.apache.jackrabbit.webdav.property.AbstractDavProperty
equals, getName, hashCode, isInvisibleInAllprop
 
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 isInvisibleInAllprop)
Creates a new WebDAV property with the given DavPropertyName

Parameters:
name - the name of the property
value - the value of the property
isInvisibleInAllprop - A value of true, defines this property to be invisible in PROPFIND/allprop It will not be returned in a DAV:allprop PROPFIND request.

HrefProperty

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

Parameters:
name - the name of the property
value - the value of the property
isInvisibleInAllprop - A value of true, defines this property to be invisible in PROPFIND/allprop It will not be returned in a DAV:allprop PROPFIND 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 -
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<String[]>
Parameters:
document -
Returns:
Xml representation
See Also:
DomUtil.hrefToXml(String,org.w3c.dom.Document)

getValue

public String[] getValue()
Returns an array of String.

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

getHrefs

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

Returns:
list of href String


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.