Class AbstractDavProperty<T>

java.lang.Object
org.apache.jackrabbit.webdav.property.AbstractDavProperty<T>
All Implemented Interfaces:
DavConstants, DavProperty<T>, PropEntry, XmlSerializable
Direct Known Subclasses:
DefaultDavProperty, HrefProperty, ResourceType

public abstract class AbstractDavProperty<T> extends Object implements DavProperty<T>
AbstractDavProperty provides generic METHODS used by various implementations of the DavProperty interface.
  • Constructor Details

    • AbstractDavProperty

      public AbstractDavProperty(DavPropertyName name, boolean isInvisibleInAllprop)
      Create a new AbstractDavProperty with the given DavPropertyName and a boolean flag indicating whether this property should be suppressed in PROPFIND/allprop responses.
  • Method Details

    • hashCode

      public int hashCode()
      Computes the hash code using this property's name and value.
      Overrides:
      hashCode in class Object
      Returns:
      the hash code
    • equals

      public boolean equals(Object obj)
      Checks if this property has the same name and value as the given one.
      Overrides:
      equals in class Object
      Parameters:
      obj - the object to compare to
      Returns:
      true if the 2 objects are equal; false otherwise
    • toXml

      public Element toXml(Document document)
      Return a XML element representation of this property. The value of the property will be added as text or as child element.
       new DavProperty("displayname", "WebDAV Directory").toXml
       gives a element like:
       <D:displayname>WebDAV Directory</D:displayname>
      
       new DavProperty("resourcetype", new Element("collection")).toXml
       gives a element like:
       <D:resourcetype><D:collection/></D:resourcetype>
      
       Element[] customVals = { new Element("bla", customNamespace), new Element("bli", customNamespace) };
       new DavProperty("custom-property", customVals, customNamespace).toXml
       gives an element like
       <Z:custom-property>
          <Z:bla/>
          <Z:bli/>
       </Z:custom-property>
       
      Specified by:
      toXml in interface XmlSerializable
      Parameters:
      document -
      Returns:
      a XML element of this property
      See Also:
    • getName

      public DavPropertyName getName()
      Returns the name of this property.
      Specified by:
      getName in interface DavProperty<T>
      Returns:
      name
      See Also:
    • isInvisibleInAllprop

      public boolean isInvisibleInAllprop()
      Return true if this property should be suppressed in a PROPFIND/DAV:allprop response. See RFC 4918, Section 9.1.
      Specified by:
      isInvisibleInAllprop in interface DavProperty<T>
      Returns:
      true, if this property should be suppressed in a PROPFIND/allprop response
      See Also: