com.cc.framework.util.parser.handler
Class HtmlToTextHandler

java.lang.Object
  extended bycom.cc.framework.util.parser.handler.HtmlToTextHandler
All Implemented Interfaces:
HtmlHandler

public class HtmlToTextHandler
extends java.lang.Object
implements HtmlHandler

This handler is used to convert HTML to raw text

Version:
$Revision: 1.1 $
Author:
Harald Schulz

Field Summary
private  java.lang.StringBuffer buffer
          The resulting string buffer
 
Fields inherited from interface com.cc.framework.util.parser.HtmlHandler
JSP_DECLARATION, JSP_EXPRESSION, JSP_SCRIPT, M_CLOSING, M_INLINE, M_OPENING
 
Constructor Summary
HtmlToTextHandler()
           
 
Method Summary
 java.lang.String getResult()
           
 void handleCharacters(char[] ch, int start, int length)
          Is called to process CDATA
 void handleComment(char[] ch, int start, int length)
          Is called to process a HTML comment
 void handleDocument(int mode)
          Is called at the beginning or the end of the document
 void handleElement(java.lang.String name, HtmlAttributes attributes, int mode)
          Is called at the beginning or the end of an element
 void handleEntity(java.lang.String entity, char character)
          Is called to process an entity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buffer

private java.lang.StringBuffer buffer
The resulting string buffer

Constructor Detail

HtmlToTextHandler

public HtmlToTextHandler()
Method Detail

getResult

public java.lang.String getResult()
Returns:
returns the processing result

handleCharacters

public void handleCharacters(char[] ch,
                             int start,
                             int length)
Description copied from interface: HtmlHandler
Is called to process CDATA

Specified by:
handleCharacters in interface HtmlHandler
Parameters:
ch - the character buffer
start - the starting index within the buffer
length - the number of characters
See Also:
HtmlHandler.handleCharacters(char[], int, int)

handleComment

public void handleComment(char[] ch,
                          int start,
                          int length)
Description copied from interface: HtmlHandler
Is called to process a HTML comment

Specified by:
handleComment in interface HtmlHandler
Parameters:
ch - the character buffer
start - the starting index within the buffer
length - the number of characters
See Also:
HtmlHandler.handleComment(char[], int, int)

handleDocument

public void handleDocument(int mode)
Description copied from interface: HtmlHandler
Is called at the beginning or the end of the document

Specified by:
handleDocument in interface HtmlHandler
Parameters:
mode - one of the M_xxx constants
See Also:
HtmlHandler.handleDocument(int)

handleElement

public void handleElement(java.lang.String name,
                          HtmlAttributes attributes,
                          int mode)
Description copied from interface: HtmlHandler
Is called at the beginning or the end of an element

Specified by:
handleElement in interface HtmlHandler
Parameters:
name - the element name
attributes - the attribute list of the element
mode - one of the M_xxx constants
See Also:
HtmlHandler.handleElement(java.lang.String, com.cc.framework.util.parser.HtmlAttributes, int)

handleEntity

public void handleEntity(java.lang.String entity,
                         char character)
Description copied from interface: HtmlHandler
Is called to process an entity

Specified by:
handleEntity in interface HtmlHandler
Parameters:
entity - the entity name (with '&' and ';')
character - the corresponding character code
See Also:
HtmlHandler.handleEntity(java.lang.String, char)


Copyright © 2000-2005 SCC Informationssysteme GmbH. All Rights Reserved.