xml
Class HtmlParser
java.lang.Object
javax.swing.text.EditorKit
javax.swing.text.DefaultEditorKit
javax.swing.text.StyledEditorKit
javax.swing.text.html.HTMLEditorKit
xml.HtmlParser
- All Implemented Interfaces:
- Serializable, Cloneable, Accessible
public class HtmlParser
- extends HTMLEditorKit
A class that utilizes the hidden java html-parsing features.
- See Also:
- Serialized Form
| Fields inherited from class javax.swing.text.html.HTMLEditorKit |
BOLD_ACTION, COLOR_ACTION, DEFAULT_CSS, FONT_CHANGE_BIGGER, FONT_CHANGE_SMALLER, IMG_ALIGN_BOTTOM, IMG_ALIGN_MIDDLE, IMG_ALIGN_TOP, IMG_BORDER, ITALIC_ACTION, LOGICAL_STYLE_ACTION, PARA_INDENT_LEFT, PARA_INDENT_RIGHT |
| Fields inherited from class javax.swing.text.DefaultEditorKit |
backwardAction, beepAction, beginAction, beginLineAction, beginParagraphAction, beginWordAction, copyAction, cutAction, defaultKeyTypedAction, deleteNextCharAction, deleteNextWordAction, deletePrevCharAction, deletePrevWordAction, downAction, endAction, endLineAction, EndOfLineStringProperty, endParagraphAction, endWordAction, forwardAction, insertBreakAction, insertContentAction, insertTabAction, nextWordAction, pageDownAction, pageUpAction, pasteAction, previousWordAction, readOnlyAction, selectAllAction, selectionBackwardAction, selectionBeginAction, selectionBeginLineAction, selectionBeginParagraphAction, selectionBeginWordAction, selectionDownAction, selectionEndAction, selectionEndLineAction, selectionEndParagraphAction, selectionEndWordAction, selectionForwardAction, selectionNextWordAction, selectionPreviousWordAction, selectionUpAction, selectLineAction, selectParagraphAction, selectWordAction, upAction, writableAction |
|
Constructor Summary |
HtmlParser(HTMLEditorKit.ParserCallback callback)
We use the hidden html parsing capabilities of the swing editor kit to
parse a given source using the specified callback object. |
|
Method Summary |
void |
parseFile(File read)
Parses html input from a file. |
void |
parseURL(URL html)
Parses html from an url. |
| Methods inherited from class javax.swing.text.html.HTMLEditorKit |
clone, createDefaultDocument, createInputAttributes, deinstall, getAccessibleContext, getActions, getContentType, getDefaultCursor, getInputAttributes, getLinkCursor, getParser, getStyleSheet, getViewFactory, insertHTML, install, isAutoFormSubmission, read, setAutoFormSubmission, setDefaultCursor, setLinkCursor, setStyleSheet, write |
parser
private HTMLEditorKit.Parser parser
- The parser object.
invoke
private HTMLEditorKit.ParserCallback invoke
- The callback object that is invoked during parsing.
HtmlParser
public HtmlParser(HTMLEditorKit.ParserCallback callback)
- We use the hidden html parsing capabilities of the swing editor kit to
parse a given source using the specified callback object. For customized
parsing, you should override desired methods in
HTMLEditorKit.ParserCallback.
parseFile
public void parseFile(File read)
throws IOException
- Parses html input from a file. Parsing is done by invoking methods in the
callback object.
- Throws:
IOException
parseURL
public void parseURL(URL html)
throws IOException
- Parses html from an url.
- Throws:
IOException