|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.cometway.httpd.HTMLStringTools
public class HTMLStringTools
This class has a collection of static methods for HTML/HTTP related string manipulation.
| Field Summary | |
|---|---|
protected static java.lang.String |
EOL
|
| Constructor Summary | |
|---|---|
HTMLStringTools()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
completeURLs(java.lang.String data,
java.lang.String refURL)
This method completes all the relative URLs found in the data based off reference URL passed in. |
protected static void |
convertHTMLListToPlainText(XMLToken t,
XMLParser parser,
java.lang.StringBuffer b,
int depth)
|
protected static void |
convertHTMLObjectToPlainText(XMLToken t,
XMLParser parser,
java.lang.StringBuffer b)
|
static java.lang.String |
convertHTMLToPlainText(java.lang.String html)
|
protected static java.lang.String |
convertPlainTextLineToHTML(java.lang.String s)
|
static java.lang.String |
convertPlainTextToHTML(java.lang.String s)
|
static java.lang.String |
decode(java.lang.String in)
This method decodes an encoded URL. |
static java.lang.String |
encode(java.lang.String in)
This method encodes a URL and the data embedded in the URL so that it can be requested. |
static java.lang.String |
encode(java.lang.String in,
boolean fullEncode,
boolean encodeForwardSlash)
This method encodes a URL and the data embedded in the URL so that it can be requested. |
static java.lang.String |
extractIMGTag(java.lang.String data)
This method extracts the first img tag that is in the data |
static java.lang.String |
extractIMGTag(java.lang.String data,
org.apache.oro.text.perl.Perl5Util perl)
This method extracts the first img tag that is in the data |
static java.lang.String |
extractURL(java.lang.String data)
* This method returns the first url that it finds in data. |
protected static int |
hexToInt(java.lang.String hex)
|
protected static java.lang.String |
intToHex(int i)
|
static void |
main(java.lang.String[] args)
|
static java.lang.String |
removeFormTags(java.lang.String text)
This utility method removes form tags. |
static java.lang.String |
removeFormTags(java.lang.String text,
org.apache.oro.text.perl.Perl5Util perl)
This utility method removes form tags. |
static java.lang.String |
removeHRTags(java.lang.String text)
This utility method removes horizontal rule tags. |
static java.lang.String |
removeHRTags(java.lang.String text,
org.apache.oro.text.perl.Perl5Util perl)
This utility method removes horizontal rule tags. |
static java.lang.String |
removeHTMLTags(java.lang.String text)
This method removes all the HTML tags in the data |
static java.lang.String |
removeHTMLTags(java.lang.String text,
org.apache.oro.text.perl.Perl5Util perl)
This method removes all the HTML tags in the data |
static java.lang.String |
removeListTags(java.lang.String text)
This utility method removes list tags. |
static java.lang.String |
removeListTags(java.lang.String text,
org.apache.oro.text.perl.Perl5Util perl)
This utility method removes list tags. |
static java.lang.String |
removeTableTags(java.lang.String text)
This utility method removes table tags. |
static java.lang.String |
removeTableTags(java.lang.String text,
org.apache.oro.text.perl.Perl5Util perl)
This utility method removes table tags. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final java.lang.String EOL
| Constructor Detail |
|---|
public HTMLStringTools()
| Method Detail |
|---|
public static java.lang.String extractIMGTag(java.lang.String data,
org.apache.oro.text.perl.Perl5Util perl)
public static java.lang.String extractIMGTag(java.lang.String data)
public static java.lang.String removeHTMLTags(java.lang.String text)
public static java.lang.String removeHTMLTags(java.lang.String text,
org.apache.oro.text.perl.Perl5Util perl)
public static java.lang.String removeFormTags(java.lang.String text)
public static java.lang.String removeFormTags(java.lang.String text,
org.apache.oro.text.perl.Perl5Util perl)
public static java.lang.String removeTableTags(java.lang.String text)
public static java.lang.String removeTableTags(java.lang.String text,
org.apache.oro.text.perl.Perl5Util perl)
public static java.lang.String removeHRTags(java.lang.String text)
public static java.lang.String removeHRTags(java.lang.String text,
org.apache.oro.text.perl.Perl5Util perl)
public static java.lang.String removeListTags(java.lang.String text)
public static java.lang.String removeListTags(java.lang.String text,
org.apache.oro.text.perl.Perl5Util perl)
public static java.lang.String extractURL(java.lang.String data)
public static java.lang.String completeURLs(java.lang.String data,
java.lang.String refURL)
public static java.lang.String encode(java.lang.String in)
public static java.lang.String encode(java.lang.String in,
boolean fullEncode,
boolean encodeForwardSlash)
Currently, the encoding scheme works like this:
spaces are encoded as '+'
all letters, numbers, and the '*', '-', '.', '@', and '_' characters are not encoded
everything else will be encoded as '%XY' where X and Y are the hex value of the character
public static java.lang.String decode(java.lang.String in)
protected static int hexToInt(java.lang.String hex)
protected static java.lang.String intToHex(int i)
public static java.lang.String convertHTMLToPlainText(java.lang.String html)
protected static void convertHTMLListToPlainText(XMLToken t,
XMLParser parser,
java.lang.StringBuffer b,
int depth)
throws XMLParserException
XMLParserException
protected static void convertHTMLObjectToPlainText(XMLToken t,
XMLParser parser,
java.lang.StringBuffer b)
throws XMLParserException
XMLParserExceptionprotected static java.lang.String convertPlainTextLineToHTML(java.lang.String s)
public static java.lang.String convertPlainTextToHTML(java.lang.String s)
public static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||