Class DavPropertyNameSet
- java.lang.Object
-
- org.apache.jackrabbit.webdav.property.PropContainer
-
- org.apache.jackrabbit.webdav.property.DavPropertyNameSet
-
- All Implemented Interfaces:
Iterable<DavPropertyName>
,DavConstants
,XmlSerializable
public class DavPropertyNameSet extends PropContainer implements Iterable<DavPropertyName>
DavPropertyNameSet
represents a Set ofDavPropertyName
objects.
-
-
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
Constructors Constructor Description DavPropertyNameSet()
Create a new empty set.DavPropertyNameSet(DavPropertyNameSet initialSet)
Create a newDavPropertyNameSet
with the given initial values.DavPropertyNameSet(Element propElement)
Create a newDavPropertyNameSet
from the given DAV:prop element.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(String localName, Namespace namespace)
Creates a DavPropertyName from the given parameters and add it to this set.boolean
add(DavPropertyName propertyName)
Adds the specifiedDavPropertyName
object to this set if it is not already present.boolean
addAll(DavPropertyNameSet propertyNames)
Add the property names contained in the specified set to this set.boolean
addContent(PropEntry contentEntry)
Tries to add the specified entry to thePropContainer
and returns a boolean indicating whether the content could be added to the internal set/map.boolean
contains(DavPropertyName name)
Returns true if thisPropContainer
contains a content element that matches the givenDavPropertyName
.Collection<DavPropertyName>
getContent()
Returns the collection that contains all the content elements of thisPropContainer
.int
getContentSize()
Returns the number of property related content elements that are present in thisPropContainer
.boolean
isEmpty()
Returns true if the PropContainer does not yet contain any content elements.DavPropertyNameIterator
iterator()
boolean
remove(DavPropertyName propertyName)
Removes the specifiedDavPropertyName
object 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
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
DavPropertyNameSet
public DavPropertyNameSet()
Create a new empty set.
-
DavPropertyNameSet
public DavPropertyNameSet(DavPropertyNameSet initialSet)
Create a newDavPropertyNameSet
with the given initial values.- Parameters:
initialSet
-
-
DavPropertyNameSet
public DavPropertyNameSet(Element propElement)
Create a newDavPropertyNameSet
from the given DAV:prop element.- Parameters:
propElement
-- Throws:
IllegalArgumentException
- if the specified element isnull
or is not a DAV:prop element.
-
-
Method Detail
-
add
public boolean add(DavPropertyName propertyName)
Adds the specifiedDavPropertyName
object to this set if it is not already present.- Parameters:
propertyName
- element to be added to this set.- Returns:
true
if the set did not already contain the specified element.
-
add
public boolean add(String localName, Namespace namespace)
Creates a DavPropertyName from the given parameters and add it to this set.- Parameters:
localName
-namespace
-- Returns:
true
if the set did not already contain the specified property name.
-
addAll
public boolean addAll(DavPropertyNameSet propertyNames)
Add the property names contained in the specified set to this set.- Parameters:
propertyNames
-- Returns:
- true if the set has been modified by this call.
-
remove
public boolean remove(DavPropertyName propertyName)
Removes the specifiedDavPropertyName
object from this set.- Parameters:
propertyName
-- Returns:
- true if the given property name could be removed.
- See Also:
HashSet.remove(Object)
-
iterator
public DavPropertyNameIterator iterator()
- Specified by:
iterator
in interfaceIterable<DavPropertyName>
- Returns:
- Iterator over all
DavPropertyName
s contained in this set.
-
contains
public boolean contains(DavPropertyName name)
Description copied from class:PropContainer
Returns true if thisPropContainer
contains a content element that matches the givenDavPropertyName
.- Specified by:
contains
in classPropContainer
- Returns:
- true if any of the content elements (be it a DavProperty or a DavPropertyName only) matches the given name.
- See Also:
PropContainer.contains(DavPropertyName)
-
addContent
public boolean addContent(PropEntry contentEntry)
Description copied from class:PropContainer
Tries to add the specified entry to thePropContainer
and returns a boolean indicating whether the content could be added to the internal set/map.- Specified by:
addContent
in classPropContainer
- Parameters:
contentEntry
- NOTE that an instance ofDavPropertyName
in order to successfully add the given entry.- Returns:
- true if contentEntry is an instance of
DavPropertyName
that could be added to this set. False otherwise. - See Also:
PropContainer.addContent(Object)
-
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 classPropContainer
- 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 thisPropContainer
.- Specified by:
getContentSize
in classPropContainer
- Returns:
- number of content elements
- See Also:
PropContainer.getContentSize()
-
getContent
public Collection<DavPropertyName> getContent()
Description copied from class:PropContainer
Returns the collection that contains all the content elements of thisPropContainer
.- Specified by:
getContent
in classPropContainer
- Returns:
- collection representing the contents of this
PropContainer
. - See Also:
PropContainer.getContent()
-
-