Interface DocumentType

  • All Known Implementing Classes:
    DocumentType._DocumentType

    public interface DocumentType
    Holds the information describing the type of the document.

    The type of the document such as HTML, PDF, XML etc. This does not include the charset.

    • Field Detail

      • MIME_HTML_TEXT

        static final DocumentType MIME_HTML_TEXT
        Simple html MIME type which should be used when a filter converts a document to html.
      • MIME_APPLICATION_JSON_TEXT

        static final DocumentType MIME_APPLICATION_JSON_TEXT
        Simple json MIME type which should be used when a filter converts a document to json.
      • APPLICATION_JSON_TEXT

        @Deprecated
        static final DocumentType APPLICATION_JSON_TEXT
        Deprecated.
        Simple json MIME type which should be used when a filter converts a document to json.
      • MIME_XML_TEXT

        static final DocumentType MIME_XML_TEXT
        Simple xml MIME type which should be used when a filter converts a document to xml.
      • MIME_CSV_TEXT

        static final DocumentType MIME_CSV_TEXT
        Standard CSV MIME type which should be used when a filter converts a document to CSV
      • MIME_XHTML_TEXT

        @Deprecated
        static final DocumentType MIME_XHTML_TEXT
        Deprecated.
        Deprecated do not use, use MIME_XHTML instead.
      • MIME_XHTML_XML

        static final DocumentType MIME_XHTML_XML
        Simple xhtml MIME type which should be used when a filter converts a document to xhtml.
      • MIME_UNKNOWN

        static final DocumentType MIME_UNKNOWN
        A mime type that is unknown. Filters may be written to detect this and replace the mime type with something better.
      • MIME_TEXT_PLAIN

        static final DocumentType MIME_TEXT_PLAIN
        A document type for plain text documents.
    • Method Detail

      • isHTML

        boolean isHTML()
        Returns:
        true if the document type is considered to be HTML, includes xhtml, otherwise false.
      • isXML

        boolean isXML()
        Returns:
        true if the document type is considered to be XML, includes xhtml, otherwise false.
      • isJSON

        boolean isJSON()
        Returns:
        true if the document type is considered to be JSON, otherwise false.
      • asContentType

        String asContentType()
        Gets the document type as a Content-Type header value.
        Returns:
        the document type as a HTTP compatible Content-Type.