|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.text.html.HTMLEditorKit.ParserCallback edu.nrao.sss.html.HtmlTableTagHandler
public class HtmlTableTagHandler
A handler of table-related HTML tags that may be called by subclasses of
HTMLEditorKit.Parser
. Example of use:
ParserDelegator parser = new ParserDelegator(); parser.parse(new InputStreamReader(htmlPage.openStream()), new HtmlTableTagHandler(myTableList), true);
Version Info:
$Revision: 545 $ |
$Date: 2007-04-19 10:38:45 -0600 (Thu, 19 Apr 2007) $ |
$Author: dharland $ |
Field Summary |
---|
Fields inherited from class javax.swing.text.html.HTMLEditorKit.ParserCallback |
---|
IMPLIED |
Constructor Summary | |
---|---|
HtmlTableTagHandler(int tableOccurrenceToRead,
HtmlTable destination)
Creates a handler that will place the nth occurrence of an HTML table presented to it into destination , where n is
tableOccurrenceToRead . |
|
HtmlTableTagHandler(List<HtmlTable> destination)
Creates a handler that will append all tables parsed to the given list. |
Method Summary | |
---|---|
void |
flush()
|
void |
handleEndTag(HTML.Tag tag,
int pos)
Handles end tags for table, table row, table data, and table header. |
void |
handleError(String errMsg,
int pos)
|
void |
handleSimpleTag(HTML.Tag tag,
MutableAttributeSet attrs,
int pos)
If the simple tag is inside a table cell, it is added to that cell's unparsed contents, otherwise it is ignored. |
void |
handleStartTag(HTML.Tag tag,
MutableAttributeSet attrs,
int pos)
Handles start tags for table, table row, table data, and table header. |
void |
handleText(char[] data,
int pos)
If the text is inside a table cell, it is added to that cell's unparsed contents, otherwise it is ignored. |
void |
reset()
|
void |
reset(int tableOccurrenceToRead,
HtmlTable destination)
|
void |
reset(List<HtmlTable> destination)
|
Methods inherited from class javax.swing.text.html.HTMLEditorKit.ParserCallback |
---|
handleComment, handleEndOfLineString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HtmlTableTagHandler(int tableOccurrenceToRead, HtmlTable destination)
destination
, where n is
tableOccurrenceToRead
. Indexing begins with zero.
Note: a table inside of another table will not be counted as a new table for purposes of counting occurrences.
tableOccurrenceToRead
- the occurrence of an HTML table to be saved.
Indexing begins at zero.destination
- the table to populate. This value must not be null.
If it is, the parsing process will throw a
NullPointerException
.public HtmlTableTagHandler(List<HtmlTable> destination)
destination
- the list to which parsed tables will be appended.
This list may or may not be empty, but must not be
null.
If it is, the parsing process will throw a
NullPointerException
.Method Detail |
---|
public void reset()
public void reset(int tableOccurrenceToRead, HtmlTable destination)
public void reset(List<HtmlTable> destination)
public void handleStartTag(HTML.Tag tag, MutableAttributeSet attrs, int pos)
table cell
, in which case it is added to the cell's unparsed content
without being interpreted as an HTML element.
handleStartTag
in class HTMLEditorKit.ParserCallback
public void handleEndTag(HTML.Tag tag, int pos)
table cell
, in which case it is added to the cell's unparsed content
without being interpreted as an HTML element.
handleEndTag
in class HTMLEditorKit.ParserCallback
public void handleSimpleTag(HTML.Tag tag, MutableAttributeSet attrs, int pos)
handleSimpleTag
in class HTMLEditorKit.ParserCallback
public void handleText(char[] data, int pos)
handleText
in class HTMLEditorKit.ParserCallback
public void flush()
flush
in class HTMLEditorKit.ParserCallback
public void handleError(String errMsg, int pos)
handleError
in class HTMLEditorKit.ParserCallback
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |