com.openexchange.mail.text.parser.handler
Class DumperHTMLHandler

java.lang.Object
  extended by com.openexchange.mail.text.parser.handler.DumperHTMLHandler
All Implemented Interfaces:
HTMLHandler

public final class DumperHTMLHandler
extends java.lang.Object
implements HTMLHandler

DumperHTMLHandler - Used to debug HTML parsing behavior.

Author:
Thorben Betten

Constructor Summary
DumperHTMLHandler()
          Initializes a new DumperHTMLHandler.
 
Method Summary
 java.lang.String getHTML()
           
 java.lang.String getString()
          Gets the string
 void handleCDATA(java.lang.String text)
          Handles specified CDATA segment's text; e.g.
 void handleComment(java.lang.String comment)
          Handles specified comment.
 void handleDocDeclaration(java.lang.String docDecl)
          Handles the DOCTYPE declaration.
 void handleEndTag(java.lang.String tag)
          Handles specified end tag.
 void handleError(java.lang.String errorMsg)
          Handles specified error.
 void handleSimpleTag(java.lang.String tag, java.util.Map<java.lang.String,java.lang.String> attributes)
          Handles specified simple tag.
 void handleStartTag(java.lang.String tag, java.util.Map<java.lang.String,java.lang.String> attributes)
          Handles specified start tag.
 void handleText(java.lang.String text, boolean ignorable)
          Handles specified text.
 void handleXMLDeclaration(java.lang.String version, java.lang.Boolean standalone, java.lang.String encoding)
          Handles the <?
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DumperHTMLHandler

public DumperHTMLHandler()
Initializes a new DumperHTMLHandler.

Method Detail

handleXMLDeclaration

public void handleXMLDeclaration(java.lang.String version,
                                 java.lang.Boolean standalone,
                                 java.lang.String encoding)
Description copied from interface: HTMLHandler
Handles the <?xml... ?> declaration.

Specified by:
handleXMLDeclaration in interface HTMLHandler
Parameters:
version - The version; either "1.0" or null
standalone - The standalone boolean value; either Boolean.TRUE, Boolean.FALSE, or null
encoding - The encoding; the charset name or null

handleComment

public void handleComment(java.lang.String comment)
Description copied from interface: HTMLHandler
Handles specified comment. Specified value is without leading "<!--" and without trailing "-->".

Specified by:
handleComment in interface HTMLHandler
Parameters:
comment - The comment

handleCDATA

public void handleCDATA(java.lang.String text)
Description copied from interface: HTMLHandler
Handles specified CDATA segment's text; e.g. 'fo<o' from '<![CDATA[fo<o]]>'.

Specified by:
handleCDATA in interface HTMLHandler
Parameters:
text - The CDATA segment's text

handleDocDeclaration

public void handleDocDeclaration(java.lang.String docDecl)
Description copied from interface: HTMLHandler
Handles the DOCTYPE declaration. Specified value is without leading "<!DOCTYPE" and without trailing ">"; e.g.
 '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'
 
yields
  ' html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"'
 

Specified by:
handleDocDeclaration in interface HTMLHandler

handleEndTag

public void handleEndTag(java.lang.String tag)
Description copied from interface: HTMLHandler
Handles specified end tag.

Specified by:
handleEndTag in interface HTMLHandler
Parameters:
tag - The tag's name

handleError

public void handleError(java.lang.String errorMsg)
Description copied from interface: HTMLHandler
Handles specified error.

Specified by:
handleError in interface HTMLHandler
Parameters:
errorMsg - The error message

handleSimpleTag

public void handleSimpleTag(java.lang.String tag,
                            java.util.Map<java.lang.String,java.lang.String> attributes)
Description copied from interface: HTMLHandler
Handles specified simple tag.

Specified by:
handleSimpleTag in interface HTMLHandler
Parameters:
tag - The tag's name
attributes - The tag's attributes as an unmodifiable map

handleStartTag

public void handleStartTag(java.lang.String tag,
                           java.util.Map<java.lang.String,java.lang.String> attributes)
Description copied from interface: HTMLHandler
Handles specified start tag.

Specified by:
handleStartTag in interface HTMLHandler
Parameters:
tag - The tag's name
attributes - The tag's attributes as an unmodifiable map

handleText

public void handleText(java.lang.String text,
                       boolean ignorable)
Description copied from interface: HTMLHandler
Handles specified text.

Note: Specified text contains all control characters from corresponding HTML content; e.g.:

 Sorry if my article tried to imply that this is a
           new thing (I hope it hasn't).
 
will be given as:
 Sorry if my article tried to imply that this is a
           new thing (I hope it hasn't).
 

Note: A text only containing whitespace characters is omitted.

Specified by:
handleText in interface HTMLHandler
Parameters:
text - The text
ignorable - true if specified text may be ignored since it only serves for formatting; otherwise false

getString

public java.lang.String getString()
Gets the string

Returns:
The string

getHTML

public java.lang.String getHTML()