|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.htmlutil.TextParser
wt.htmlutil.UrlAwareParser
Implements TextParser's parseWord() method to search a stream word by word for URLs. UrlAwareParser is itself an abstract class, however, since there is no obvious default behavior for how detection/non-detection of an URL should be handled. Hence the abstract handleUrl() and handleNotUrl() methods.
Field Summary | |
(package private) static String |
HTTP
Deprecated. |
(package private) static String[] |
protocols
Deprecated. An array of protocol strings that the parser should test for. |
(package private) static String |
WWW
Deprecated. |
Fields inherited from class wt.htmlutil.TextParser |
|
Constructor Summary | |
UrlAwareParser(Reader in)
Deprecated. |
|
UrlAwareParser(String in)
Deprecated. |
Method Summary | |
private int |
getFirstValidCharIndex(String word)
Deprecated. |
private int |
getLastValidCharIndex(String word)
Deprecated. |
(package private) void |
handleEof()
Deprecated. Empty method. |
(package private) void |
handleEol(String eolChar)
Deprecated. Empty method. |
(package private) abstract void |
handleNotUrl(String word)
Deprecated. Called when a non-url is found. |
(package private) void |
handleNumber(double num)
Deprecated. |
(package private) abstract void |
handleUrl(String start,
String url,
String end,
boolean isWWW)
Deprecated. Called when a valid url is found. |
(package private) void |
handleWord(String word)
Deprecated. Parses a word, calls handleUrl or handleNotUrl as appropriate. |
(package private) void |
parseWord(String word)
Deprecated. |
Methods inherited from class wt.htmlutil.TextParser |
handleDefault, parse |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
static final String[] protocols
static final String WWW
static final String HTTP
Constructor Detail |
public UrlAwareParser(Reader in)
public UrlAwareParser(String in)
Method Detail |
void handleWord(String word) throws IOException
handleWord
in class TextParser
IOException
void parseWord(String word) throws IOException
IOException
void handleEol(String eolChar) throws IOException
handleEol
in class TextParser
IOException
void handleEof()
handleEof
in class TextParser
void handleNumber(double num) throws IOException
handleNumber
in class TextParser
IOException
abstract void handleUrl(String start, String url, String end, boolean isWWW) throws IOException
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.".
IOException
abstract void handleNotUrl(String word) throws IOException
IOException
private int getFirstValidCharIndex(String word)
private int getLastValidCharIndex(String word)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |