org.apache.jackrabbit.webdav.property
Class DavPropertySet

java.lang.Object
  extended by org.apache.jackrabbit.webdav.property.PropContainer
      extended by org.apache.jackrabbit.webdav.property.DavPropertySet
All Implemented Interfaces:
Iterable<DavProperty<?>>, DavConstants, XmlSerializable

public class DavPropertySet
extends PropContainer
implements Iterable<DavProperty<?>>

The DavPropertySet class represents a set of WebDAV property.


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
DavPropertySet()
           
 
Method Summary
 DavProperty<?> add(DavProperty<?> property)
          Adds a new property to this set.
 void addAll(DavPropertySet pset)
           
 boolean addContent(PropEntry contentEntry)
          Tries to add the specified entry to the PropContainer and returns a boolean indicating whether the content could be added to the internal set/map.
 boolean contains(DavPropertyName name)
          Checks if this set contains the property with the specified name.
 DavProperty<?> get(DavPropertyName name)
          Retrieves the property with the specified name
 DavProperty<?> get(String name)
          Retrieves the property with the specified name and the default WebDAV namespace.
 DavProperty<?> get(String name, Namespace namespace)
          Retrieves the property with the specified name and namespace.
 Collection<? extends PropEntry> getContent()
          Returns the collection that contains all the content elements of this PropContainer.
 int getContentSize()
          Returns the number of property related content elements that are present in this PropContainer.
 DavPropertyName[] getPropertyNames()
          Return the names of all properties present in this set.
 boolean isEmpty()
          Returns true if the PropContainer does not yet contain any content elements.
 DavPropertyIterator iterator()
          Returns an iterator over all property in this set.
 DavPropertyIterator iterator(Namespace namespace)
          Returns an iterator over all those property in this set, that have the indicated namespace.
 DavProperty<?> remove(DavPropertyName name)
          Removes the indicated property from this set.
 DavProperty<?> remove(String name)
          Removes the property with the specified name and the default WebDAV namespace.
 DavProperty<?> remove(String name, Namespace namespace)
          Removes the property with the specified name and namespace from this set.
 
Methods inherited from class org.apache.jackrabbit.webdav.property.PropContainer
addContent, toXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DavPropertySet

public DavPropertySet()
Method Detail

add

public DavProperty<?> add(DavProperty<?> property)
Adds a new property to this set.

Parameters:
property - The property to add
Returns:
The previously assigned property or null.

addAll

public void addAll(DavPropertySet pset)
Parameters:
pset - Properties to add

get

public DavProperty<?> get(String name)
Retrieves the property with the specified name and the default WebDAV namespace.

Parameters:
name - The name of the property to retrieve
Returns:
The desired property or null

get

public DavProperty<?> get(String name,
                          Namespace namespace)
Retrieves the property with the specified name and namespace.

Parameters:
name - The name of the property to retrieve
namespace - The namespace of the property to retrieve
Returns:
The desired property or null

get

public DavProperty<?> get(DavPropertyName name)
Retrieves the property with the specified name

Parameters:
name - The webdav property name of the property to retrieve
Returns:
The desired property or null

remove

public DavProperty<?> remove(DavPropertyName name)
Removes the indicated property from this set.

Parameters:
name - The webdav property name to remove
Returns:
The removed property or null

remove

public DavProperty<?> remove(String name)
Removes the property with the specified name and the default WebDAV namespace.

Parameters:
name - The name of the property to remove
Returns:
The removed property or null

remove

public DavProperty<?> remove(String name,
                             Namespace namespace)
Removes the property with the specified name and namespace from this set.

Parameters:
name - The name of the property to remove
namespace - The namespace of the property to remove
Returns:
The removed property or null

iterator

public DavPropertyIterator iterator()
Returns an iterator over all property in this set.

Specified by:
iterator in interface Iterable<DavProperty<?>>
Returns:
An iterator over DavProperty.

iterator

public DavPropertyIterator iterator(Namespace namespace)
Returns an iterator over all those property in this set, that have the indicated namespace.

Parameters:
namespace - The namespace of the property in the iteration.
Returns:
An iterator over DavProperty.

getPropertyNames

public DavPropertyName[] getPropertyNames()
Return the names of all properties present in this set.

Returns:
array of property names present in this set.

contains

public boolean contains(DavPropertyName name)
Checks if this set contains the property with the specified name.

Specified by:
contains in class PropContainer
Parameters:
name - The name of the property
Returns:
true if this set contains the property; false otherwise.
See Also:
PropContainer.contains(DavPropertyName)

addContent

public boolean addContent(PropEntry contentEntry)
Description copied from class: PropContainer
Tries to add the specified entry to the PropContainer and returns a boolean indicating whether the content could be added to the internal set/map.

Specified by:
addContent in class PropContainer
Parameters:
contentEntry - NOTE, that the given object must be an instance of DavProperty in order to be successfully added to this set.
Returns:
true if the specified object is an instance of DavProperty and false otherwise.
See Also:
PropContainer.addContent(PropEntry)

isEmpty

public boolean isEmpty()
Description copied from class: PropContainer
Returns true if the PropContainer does not yet contain any content elements.

Specified by:
isEmpty in class PropContainer
Returns:
true if this container is empty.
See Also:
PropContainer.isEmpty()

getContentSize

public int getContentSize()
Description copied from class: PropContainer
Returns the number of property related content elements that are present in this PropContainer.

Specified by:
getContentSize in class PropContainer
Returns:
number of content elements
See Also:
PropContainer.getContentSize()

getContent

public Collection<? extends PropEntry> getContent()
Description copied from class: PropContainer
Returns the collection that contains all the content elements of this PropContainer.

Specified by:
getContent in class PropContainer
Returns:
collection representing the contents of this PropContainer.
See Also:
PropContainer.getContent()


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