|
Lightweigth HTML Scanner 2.00 | ||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--be.arci.html.HTMLTag
Lightweight immutable class that encapsulates a HTML tag or HTML content text recognized by HTMLScanner.getTags(). A HTMLTag basically is a substring of the scanned document, with an ID field for the type of HTMLTag.
HTMLScanner.getTags(String[] asTagNames, boolean swDiscardOtherTags)| Field Summary | |
int |
iBeginIndex
the substring() beginIndex of the HTMLTag (including '<' character). |
int |
iEndIndex
the substring() endIndex of the HTMLTag (including '>' character). |
int |
iID
ID or type of the HTMLTag. |
boolean |
swCombineWhitespace
If true, multiple whitespace characters are combined to a single space (' '). |
boolean |
swParseEscapes
If true, HTML character escapes (named character entity references and numerical character references of the form "&999;") are interpreted. |
| Method Summary | |
java.lang.StringBuffer |
accumulateContent(java.lang.StringBuffer sb)
Accumulates this HTMLTag's HTML document text content into the StringBuffer argument. |
java.lang.StringBuffer |
accumulateContent(java.lang.StringBuffer sb,
boolean swParseEscapes,
boolean swCombineWhitespace)
Accumulates this HTMLTag's HTML document text content into the StringBuffer argument. |
java.lang.String |
getAttribute(java.lang.String sAttribute)
Returns the value of the named attribute in this HTMLTag. |
java.lang.String |
toString()
Returns the substring of the HTML document that defines this HTMLTag, including any contained, uncombined whitespace, uninterpreted escape sequences, and the < and > delimiters. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public final int iID
This ID is
HTMLScanner.getTags(java.lang.String[], boolean)public final int iBeginIndex
public final int iEndIndex
public final boolean swParseEscapes
accumulateContent(StringBuffer)public final boolean swCombineWhitespace
accumulateContent(StringBuffer)| Method Detail |
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.StringBuffer accumulateContent(java.lang.StringBuffer sb)
Depending on the context of the containing HTML document, character entity references and numerical character references are interpreted and multiple whitespace characters are combined to a single space (' ', or not.
This method does not change the state of this HTMLTag, so it can be called multiple times.
sb - the StringBuffer to accumulate text content into. If null, a new StringBuffer
will be allocated by this method.accumulateContent(StringBuffer sb, boolean swParseEscapes, boolean swCombineWhitespace),
swParseEscapes,
swCombineWhitespace,
iID
public java.lang.StringBuffer accumulateContent(java.lang.StringBuffer sb,
boolean swParseEscapes,
boolean swCombineWhitespace)
This method does not change the state of this HTMLTag, so it can be called multiple times.
sb - the StringBuffer to accumulate text content into. If null, a new StringBuffer will be
allocated by this method.swParseEscapes - if true, HTML character entity references and numerical character references ("&...;") escapes
are interpreted. Overrides the swParseEscapes setting of this HTMLTagswCombineWhitespace - if true, multiple whitespace characters are combined to a single space (' ').
Overrides the swCombineWhitespace setting of this HTMLTag.accumulateContent(StringBuffer sb),
iIDpublic java.lang.String getAttribute(java.lang.String sAttribute)
If the value is to represent a color value, it can be fed into HTMLColors.getColor() without testing for a valid return value.
Example
If the tag represent the syntax element <IMG SRC=donaldknut.jpg>,
a call getAttribute("src"); returns the String value "donaldknut.jpg".
This method does not change the state of this HTMLTag, so it can be called multiple times.
sAttribute - case-insensitive attribute nameHTMLColors.getColor(String sColor)
|
Lightweigth HTML Scanner 2.00 | ||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||