Class CommonMatchers

java.lang.Object
com.norconex.importer.handler.CommonMatchers

public final class CommonMatchers extends Object

Commonly used TextMatcher instances. Each matcher returned are fresh instances that can safely be modified.

As of 3.0.0, content type constants are immutable Set instances as opposed to arrays.

  • Field Details

    • XML_BASE_CONTENT_TYPES

      public static final Set<String> XML_BASE_CONTENT_TYPES

      Base content types for XML: "application/xml" and "text/xml".

    • XML_FEED_CONTENT_TYPES

      public static final Set<String> XML_FEED_CONTENT_TYPES

      ATOM, RDF, RSS, and strict XML content types:

      • application/atom+xml
      • application/rdf+xml
      • application/rss+xml
      • application/xml
      • text/xml
    • HTML_CONTENT_TYPES

      public static final Set<String> HTML_CONTENT_TYPES

      HTML/XHTML content types:

      • application/vnd.wap.xhtml+xml
      • application/xhtml+xml
      • text/html
    • XML_CONTENT_TYPES

      public static final Set<String> XML_CONTENT_TYPES

      HTML, XHTML, and XML-based content types:

      • application/atom+xml
      • application/mathml+xml
      • application/rss+xml
      • application/xhtml+xml
      • application/xml
      • application/xslt+xml
      • image/svg+xml
      • text/xml
    • DOM_CONTENT_TYPES

      public static final Set<String> DOM_CONTENT_TYPES

      Content types representing a document object model:

      • application/atom+xml
      • application/mathml+xml
      • application/rss+xml
      • application/vnd.wap.xhtml+xml
      • application/x-asp
      • application/xhtml+xml
      • application/xml
      • application/xslt+xml
      • image/svg+xml
      • text/html
      • text/xml
    • IMAGE_IO_CONTENT_TYPES

      public static final Set<String> IMAGE_IO_CONTENT_TYPES

      Content types for natively supported Java ImageIO images.

      • image/bmp
      • image/gif
      • image/jpeg
      • image/png
      • image/vnd.wap.wbmp
      • image/x-windows-bmp
  • Method Details

    • domContentTypes

      public static TextMatcher domContentTypes()

      Matcher for common content-types defining a DOM document. That is, documents that are HTML, XHTML, or XML-based. The value has to be any of these to trigger a match (case-insensitive):

      DOM_CONTENT_TYPES
      Returns:
      text matcher
    • xmlFeedContentTypes

      public static TextMatcher xmlFeedContentTypes()

      Matcher for common content-types defining an XML feed (RSS, Atom). Because XML feeds are not always declaring their content type properly, this matcher will also match base XML content types. The value has to be any of these to trigger a match (case-insensitive):

      XML_FEED_CONTENT_TYPES
      Returns:
      text matcher
    • htmlContentTypes

      public static TextMatcher htmlContentTypes()

      Matcher for common content-types defining an HTML or XHTML document. The value has to be any of these to trigger a match (case-insensitive):

      HTML_CONTENT_TYPES
      Returns:
      text matcher
    • xmlContentTypes

      public static TextMatcher xmlContentTypes()

      Common content-types defining an XML document. The value has to be any of these to trigger a match (case-insensitive):

      XML_CONTENT_TYPES
      Returns:
      text matcher
    • imageIOStandardContentTypes

      public static TextMatcher imageIOStandardContentTypes()

      Content types of standard image format supported by all Java ImageIO implementations: JPEG, PNG, GIF, BMP, WBMP. The value has to be any of these to trigger a match (case-insensitive):

      IMAGE_IO_CONTENT_TYPES
      Returns:
      text matcher
    • all

      public static TextMatcher all()

      Matches all content types.

      Returns:
      text matcher