Class BodyContentHandler

All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class BodyContentHandler extends ContentHandlerDecorator
Content handler decorator that only passes everything inside the XHTML <body/> tag to the underlying handler. Note that the <body/> tag itself is not passed on.
  • Constructor Details

    • BodyContentHandler

      public BodyContentHandler(ContentHandler handler)
      Creates a content handler that passes all XHTML body events to the given underlying content handler.
      Parameters:
      handler - content handler
    • BodyContentHandler

      public BodyContentHandler(Writer writer)
      Creates a content handler that writes XHTML body character events to the given writer.
      Parameters:
      writer - writer
    • BodyContentHandler

      public BodyContentHandler(int writeLimit)
      Creates a content handler that writes XHTML body character events to an internal string buffer. The contents of the buffer can be retrieved using the ContentHandlerDecorator.toString() method.

      The internal string buffer is bounded at the given number of characters. If this write limit is reached, then a SAXException is thrown.

      Parameters:
      writeLimit - maximum number of characters to include in the string, or -1 to disable the write limit
      Since:
      Apache Tika 0.7
    • BodyContentHandler

      public BodyContentHandler()
      Creates a content handler that writes XHTML body character events to an internal string buffer. The contents of the buffer can be retrieved using the ContentHandlerDecorator.toString() method.

      The internal string buffer is bounded at 100k characters. If this write limit is reached, then a SAXException is thrown.