wt.htmlutil
Class TextParser

java.lang.Object
  extended bywt.htmlutil.TextParser
Direct Known Subclasses:
UrlAwareParser

public abstract class TextParser
extends Object

Provides a framework for basic text parsing.


Field Summary
private  StreamTokenizer st
          Deprecated. The underlying StreamTokenizer that is used to parse the text stream.
private static String versionID
          Deprecated.  
 
Constructor Summary
TextParser(Reader istream)
          Deprecated. Creates a StreamTokenizer from istream, and then sets the StreamTokenizer's syntax table.
TextParser(String itext)
          Deprecated. Converts the itext to a Reader, then calls the other constructor.
 
Method Summary
(package private) abstract  void handleDefault(char c)
          Deprecated.  
(package private) abstract  void handleEof()
          Deprecated. Handles the end of the file.
(package private) abstract  void handleEol(String eolChar)
          Deprecated. Handles the end of a line.
(package private) abstract  void handleNumber(double num)
          Deprecated.  
(package private) abstract  void handleWord(String word)
          Deprecated. Handles a word.
 Object parse()
          Deprecated. Loops until the end of the stream is reached, calling the abstract parseWord(), handleEol() and handleEof() methods as appropriate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

versionID

private static final String versionID
Deprecated. 
See Also:
Constant Field Values

st

private StreamTokenizer st
Deprecated. 
The underlying StreamTokenizer that is used to parse the text stream.

Constructor Detail

TextParser

public TextParser(Reader istream)
Deprecated. 
Creates a StreamTokenizer from istream, and then sets the StreamTokenizer's syntax table.


TextParser

public TextParser(String itext)
Deprecated. 
Converts the itext to a Reader, then calls the other constructor.

Method Detail

parse

public Object parse()
             throws IOException
Deprecated. 
Loops until the end of the stream is reached, calling the abstract parseWord(), handleEol() and handleEof() methods as appropriate

Returns:
The default return value is null, but the option is left open for subclasses to return something valuable.
Throws:
IOException
See Also:
UrlLister, UrlAwareTextFormatter

handleWord

abstract void handleWord(String word)
                  throws IOException
Deprecated. 
Handles a word.

Throws:
IOException

handleEol

abstract void handleEol(String eolChar)
                 throws IOException
Deprecated. 
Handles the end of a line.

Throws:
IOException

handleDefault

abstract void handleDefault(char c)
                     throws IOException
Deprecated. 
Throws:
IOException

handleEof

abstract void handleEof()
Deprecated. 
Handles the end of the file.


handleNumber

abstract void handleNumber(double num)
                    throws IOException
Deprecated. 
Throws:
IOException