Class ReportInfo

  • All Implemented Interfaces:
    XmlSerializable

    public class ReportInfo
    extends java.lang.Object
    implements XmlSerializable
    The ReportInfo class encapsulates the body of a REPORT request. RFC 3253 the top Xml element being the name of the requested report. In addition a Depth header may be present (default value: DavConstants.DEPTH_0).
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean containsContentElement​(java.lang.String localName, Namespace namespace)
      Indicates whether this info contains an element with the given name/namespace.
      org.w3c.dom.Element getContentElement​(java.lang.String localName, Namespace namespace)
      Retrieves the Xml element with the given name/namespace that is a child of this info.
      java.util.List<org.w3c.dom.Element> getContentElements​(java.lang.String localName, Namespace namespace)
      Returns a list containing all child Xml elements of this info that have the specified name/namespace.
      int getDepth()
      Returns the depth field.
      DavPropertyNameSet getPropertyNameSet()
      Returns a DavPropertyNameSet providing the property names present in an eventual DavConstants.XML_PROP child element.
      java.lang.String getReportName()
      Name of the report type that will be / has been requested.
      void setContentElement​(org.w3c.dom.Element contentElement)
      Add the specified Xml element as child of this info.
      org.w3c.dom.Element toXml​(org.w3c.dom.Document document)
      Returns the xml representation of the implementing object as Element.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ReportInfo

        public ReportInfo​(ReportType type)
        Create a new ReportInfo
        Parameters:
        type -
      • ReportInfo

        public ReportInfo​(ReportType type,
                          int depth)
        Create a new ReportInfo
        Parameters:
        type -
        depth -
      • ReportInfo

        public ReportInfo​(ReportType type,
                          int depth,
                          DavPropertyNameSet propertyNames)
        Create a new ReportInfo
        Parameters:
        type -
        depth -
        propertyNames -
      • ReportInfo

        public ReportInfo​(java.lang.String typeLocalName,
                          Namespace typeNamespace)
        Create a new ReportInfo
        Parameters:
        typeLocalName -
        typeNamespace -
      • ReportInfo

        public ReportInfo​(java.lang.String typelocalName,
                          Namespace typeNamespace,
                          int depth,
                          DavPropertyNameSet propertyNames)
        Create a new ReportInfo
        Parameters:
        typelocalName -
        typeNamespace -
        depth -
        propertyNames -
      • ReportInfo

        public ReportInfo​(org.w3c.dom.Element reportElement,
                          int depth)
                   throws DavException
        Create a new ReportInfo object from the given Xml element.
        Parameters:
        reportElement -
        depth - Depth value as retrieved from the DavConstants.HEADER_DEPTH.
        Throws:
        DavException - if the report element is null.
    • Method Detail

      • getDepth

        public int getDepth()
        Returns the depth field. The request must be applied separately to the collection itself and to all members of the collection that satisfy the depth value.
        Returns:
        depth
      • getReportName

        public java.lang.String getReportName()
        Name of the report type that will be / has been requested.
        Returns:
        Name of the report type
      • containsContentElement

        public boolean containsContentElement​(java.lang.String localName,
                                              Namespace namespace)
        Indicates whether this info contains an element with the given name/namespace.
        Parameters:
        localName -
        namespace -
        Returns:
        true if an element with the given name/namespace is present in the body of the request info.
      • getContentElement

        public org.w3c.dom.Element getContentElement​(java.lang.String localName,
                                                     Namespace namespace)
        Retrieves the Xml element with the given name/namespace that is a child of this info. If no such child exists null is returned. If multiple elements with the same name exist, the first one is returned.
        Parameters:
        localName -
        namespace -
        Returns:
        Xml element with the given name/namespace or null
      • getContentElements

        public java.util.List<org.w3c.dom.Element> getContentElements​(java.lang.String localName,
                                                                      Namespace namespace)
        Returns a list containing all child Xml elements of this info that have the specified name/namespace. If this info contains no such element, an empty list is returned.
        Parameters:
        localName -
        namespace -
        Returns:
        List contain all child elements with the given name/namespace or an empty list.
      • setContentElement

        public void setContentElement​(org.w3c.dom.Element contentElement)
        Add the specified Xml element as child of this info.
        Parameters:
        contentElement -
      • getPropertyNameSet

        public DavPropertyNameSet getPropertyNameSet()
        Returns a DavPropertyNameSet providing the property names present in an eventual DavConstants.XML_PROP child element. If no such child element is present an empty set is returned.
        Returns:
        DavPropertyNameSet providing the property names present in an eventual DAV:prop child element or an empty set.
      • toXml

        public org.w3c.dom.Element toXml​(org.w3c.dom.Document document)
        Description copied from interface: XmlSerializable
        Returns the xml representation of the implementing object as Element. The given Document is used as factory and represents the owner document of the returned DOM element.
        Specified by:
        toXml in interface XmlSerializable
        Parameters:
        document -
        Returns:
        a w3c element representing this object
        See Also:
        XmlSerializable.toXml(Document)