wt.htmlutil
Class UrlAwareTextFormatter

java.lang.Object
  extended bywt.htmlutil.TextParser
      extended bywt.htmlutil.UrlAwareParser
          extended bywt.htmlutil.UrlAwareTextFormatter

public class UrlAwareTextFormatter
extends UrlAwareParser

Reformats plain text URLs in a text stream into HTML anchors.


Field Summary
private  StringBuffer sbuf
          Deprecated.  
private static String versionID
          Deprecated.  
 
Fields inherited from class wt.htmlutil.UrlAwareParser
HTTP, protocols, WWW
 
Fields inherited from class wt.htmlutil.TextParser
 
Constructor Summary
UrlAwareTextFormatter(Reader in)
          Deprecated.  
UrlAwareTextFormatter(String text)
          Deprecated.  
 
Method Summary
(package private)  void handleDefault(char c)
          Deprecated.  
(package private)  void handleNotUrl(String word)
          Deprecated. Called when a non-url is found.
(package private)  void handleUrl(String start, String url, String end, boolean isWWW)
          Deprecated. Formats an URL into an HTML anchor, then prints it to the outputstream.
static void main(String[] args)
          Deprecated.  
 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 wt.htmlutil.UrlAwareParser
handleEof, handleEol, handleNumber, handleWord, parseWord
 
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

sbuf

private StringBuffer sbuf
Deprecated. 
Constructor Detail

UrlAwareTextFormatter

public UrlAwareTextFormatter(Reader in)
Deprecated. 

UrlAwareTextFormatter

public UrlAwareTextFormatter(String text)
Deprecated. 
Method Detail

parse

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

Overrides:
parse in class TextParser
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

handleUrl

void handleUrl(String start,
               String url,
               String end,
               boolean isWWW)
         throws IOException
Deprecated. 
Formats an URL into an HTML anchor, then prints it to the outputstream.

Specified by:
handleUrl in class UrlAwareParser
Parameters:
start - Any non-alphanumerics at the start of the token.
url - The url.
end - Any non-alphanumerics at the end of the token.
isWWW - A flag indicating the url has no protocol, but begins with "www.".
Throws:
IOException
See Also:
UrlAwareParser

handleNotUrl

void handleNotUrl(String word)
            throws IOException
Deprecated. 
Description copied from class: UrlAwareParser
Called when a non-url is found.

Specified by:
handleNotUrl in class UrlAwareParser
Throws:
IOException

handleDefault

void handleDefault(char c)
             throws IOException
Deprecated. 
Specified by:
handleDefault in class TextParser
Throws:
IOException

main

public static void main(String[] args)
Deprecated.