|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--xbn.XBNObject | +--jsutil.UtilHtml
Random functions to manipulate HTML source code.
Source code: HtmlDispToActual.java
Fields inherited from class xbn.XBNObject |
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP |
Constructor Summary | |
UtilHtml()
Create a new UtilHtml . |
Method Summary | |
int |
eliminateLinks(StringOrBuffer sob_html)
Eliminate all links in the provided html. |
int |
elimTagMarkers(StringOrBuffer sob_html)
Eliminate every tag marker from the provided html. |
int |
elimTagMarkers(StringOrBuffer sob_html,
String s_tagStart)
Eliminate every tag marker from the provided html. |
void |
shrink(StringOrBuffer sob_html,
int i_shrinkBy)
Shrink the provided html. |
Methods inherited from class xbn.XBNObject |
getXMsgPrefix, sop, sopl, sopl, throwAX, throwAXIfBadStr, throwAXIfNull, throwAXSpoof |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public UtilHtml()
Create a new UtilHtml
. This does nothing.
Method Detail |
public final void shrink(StringOrBuffer sob_html, int i_shrinkBy)
Shrink the provided html.
Specifically, this function makes the following changes (assumes i_shrinkBy
is 1):
<FONT SIZE="-1">
is appended to the start (left).</FONT>
is added to the end (right).<CODE> --> </FONT><CODE>
CODE tags are too small when shrunk.</CODE> --> </CODE><FONT SIZE="-1">
<FONT SIZE="-1">
' to the beginning (left), and '</FONT>
' to the end.sob_html
- The html to shrink May not be null.i_shrinkBy
- How many font sizes should it be shrunk by? Can be negative to increase the size. If zero, this function does nothing..public final int eliminateLinks(StringOrBuffer sob_html)
Eliminate all links in the provided html.
This function calls:
elimTagMarkers(sob_html, "A")
elimTagMarkers(sob_html, "/A")
<A HREF...">
' and '</A>
') is two replacements.public final int elimTagMarkers(StringOrBuffer sob_html)
Eliminate every tag marker from the provided html.
elimTagMarkers(sob_html, null)
public final int elimTagMarkers(StringOrBuffer sob_html, String s_tagStart)
Eliminate every tag marker from the provided html.
Examples of tag markers:
<I>
</A>
<TABLE BGCOLOR="#EEEEEE">
This is fine:
<B>Some <I>html</I> to bold</B> |
This is legal html, but not legal for this class:
<B
|
sob_html
- The html to eliminate links from. May not be null.s_tagStart
- If null, then all tags markers are eliminated. If non-null, then this text must be found immediately after the '<
', or it is left untouched. For example:A
' causes all of the following tags to be deleted:<A HREF="...">
'<A NAME="...">
'<A onClick="...">
'<A>
'A HREF
' causes
<A HREF="...">
'
<a href="...">
'<A href="...">
'/A
' causes all of the following tags to be deleted:</A>
'</ANOTHERTAG>
'
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 2003-2005, Jeff Epstein, All Rights Reserved. See top of source code files for copyright notice.
http://sourceforge.net/projects/jsutiljava