Class DocumentHandlerToSAXAdapter

java.lang.Object
com.day.cq.rewriter.htmlparser.DocumentHandlerToSAXAdapter
All Implemented Interfaces:
DocumentHandler

@Deprecated public class DocumentHandlerToSAXAdapter extends Object implements DocumentHandler
Deprecated.
This is replaced by the Apache Sling Html parsing.
This is an adapter from the document handler events to SAX events.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Deprecated.
     
    static final String
    Deprecated.
     
    static final String
    Deprecated.
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    characters(char[] buffer, int offset, int length)
    Deprecated.
    Called by HtmlParser if character data and tags are to be output for which no special handling is necessary.
    void
    Deprecated.
    Receive notification of parsing end.
    void
    onEndElement(String tagName, char[] buffer, int offset, int length)
    Deprecated.
    Called by HtmlParser for the end element of a tag that requires special handling.
    void
    Deprecated.
    Receive notification of parsing start.
    void
    onStartElement(String tagName, AttributeList attributes, char[] buffer, int offset, int length, boolean endSlash)
    Deprecated.
    Called by HtmlParser for the start element of a tag that requires special handling.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • DocumentHandlerToSAXAdapter

      public DocumentHandlerToSAXAdapter(ContentHandler handler)
      Deprecated.
  • Method Details

    • characters

      public void characters(char[] buffer, int offset, int length) throws IOException
      Deprecated.
      Called by HtmlParser if character data and tags are to be output for which no special handling is necessary.
      Specified by:
      characters in interface DocumentHandler
      Parameters:
      buffer - Character data
      offset - Offset where character data starts
      length - The length of the character data
      Throws:
      IOException - IOException
      See Also:
    • onStartElement

      public void onStartElement(String tagName, AttributeList attributes, char[] buffer, int offset, int length, boolean endSlash) throws IOException
      Deprecated.
      Called by HtmlParser for the start element of a tag that requires special handling. Remembers base reference and removes invalid links.
      Specified by:
      onStartElement in interface DocumentHandler
      Parameters:
      tagName - Tag name
      attributes - List of attributes
      buffer - Contains the whole tag including attributes
      offset - Offset where the character data starts
      length - Length of the character data
      endSlash - Flag indicating whether the element is closed with an ending slash (xhtml-compliant)
      Throws:
      IOException - IOException
    • onEndElement

      public void onEndElement(String tagName, char[] buffer, int offset, int length) throws IOException
      Deprecated.
      Called by HtmlParser for the end element of a tag that requires special handling. Removes end element if corresponding start element (link) has already been removed.
      Specified by:
      onEndElement in interface DocumentHandler
      Parameters:
      tagName - Tag name
      buffer - Contains the whole tag including attributes
      offset - Offset where the character data starts
      length - Length of the character data
      Throws:
      IOException - IOException
    • onEnd

      public void onEnd() throws IOException
      Deprecated.
      Description copied from interface: DocumentHandler
      Receive notification of parsing end.
      Specified by:
      onEnd in interface DocumentHandler
      Throws:
      IOException - IOException
      See Also:
    • onStart

      public void onStart() throws IOException
      Deprecated.
      Description copied from interface: DocumentHandler
      Receive notification of parsing start.
      Specified by:
      onStart in interface DocumentHandler
      Throws:
      IOException - IOException
      See Also: