|
Java プラットフォーム 1.2 |
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Object | +--javax.swing.text.html.parser.Parser
DTD 駆動型の、単純な HTML パーサです。パーサは InputStream から HTML ファイルを読み取って、タグやデータを検出すると、各種のメソッド (サブクラスでオーバーライドされる) を呼び出します。
残念なことに、正しく実装されていない HTML パーサが数多く出回っています。その結果、書式の正しくない HTML ファイルも多数存在します。このパーサは、ほとんどの HTML ファイルの解析を試みます。すなわち、この実装は HTML を優先し、SGML の仕様とは異なっている場合もあります。
このパーサは、¥r および ¥r¥n を ¥n として扱います。開始タグの後、および終了タグの前の改行は、SGML や HTML の仕様に従って無視されます。
DTD
,
Tag
,
SimpleAttributeSet
フィールドの概要 | |
protected DTD |
dtd
|
protected boolean |
strict
このフラグは、Parser が SGML との互換性を厳密に調べるかどうかを決定します。 |
コンストラクタの概要 | |
Parser(DTD dtd)
|
メソッドの概要 | |
protected void |
endTag(boolean omitted)
終了タグを処理します。 |
protected void |
error(String err)
|
protected void |
error(String err,
String arg1)
|
protected void |
error(String err,
String arg1,
String arg2)
|
protected void |
error(String err,
String arg1,
String arg2,
String arg3)
エラーハンドラを呼び出します。 |
protected void |
flushAttributes()
|
protected SimpleAttributeSet |
getAttributes()
|
protected int |
getCurrentLine()
|
protected int |
getCurrentPos()
|
protected void |
handleComment(char[] text)
HTML のコメントを検出したときに呼び出されます。 |
protected void |
handleEmptyTag(TagElement tag)
空のタグを検出したときに呼び出されます。 |
protected void |
handleEndTag(TagElement tag)
終了タグを検出したときに呼び出されます。 |
protected void |
handleEOFInComment()
|
protected void |
handleError(int ln,
String msg)
エラーが発生したことを示します。 |
protected void |
handleStartTag(TagElement tag)
開始タグを検出したときに呼び出されます。 |
protected void |
handleText(char[] text)
PCDATA を検出したときに呼び出されます。 |
protected void |
handleTitle(char[] text)
HTML の title タグを検出したときに呼び出されます。 |
protected TagElement |
makeTag(Element elem)
|
protected TagElement |
makeTag(Element elem,
boolean fictional)
TagElement を作成します。 |
protected void |
markFirstTime(Element elem)
ドキュメント内に最初に見つかったタグにマークを付けます。 |
void |
parse(Reader in)
DTD が指定されている場合に、HTML ストリームを解析します。 |
String |
parseDTDMarkup()
文書型定義 (DTD - Document Type Definition) のマークアップ宣言を解析します。 |
protected boolean |
parseMarkupDeclarations(StringBuffer strBuff)
マークアップ宣言を解析します。 |
protected void |
startTag(TagElement tag)
開始タグを処理します。 |
クラス java.lang.Object から継承したメソッド |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
フィールドの詳細 |
protected DTD dtd
protected boolean strict
コンストラクタの詳細 |
public Parser(DTD dtd)
メソッドの詳細 |
protected int getCurrentLine()
protected TagElement makeTag(Element elem, boolean fictional)
protected TagElement makeTag(Element elem)
protected SimpleAttributeSet getAttributes()
protected void flushAttributes()
protected void handleText(char[] text)
protected void handleTitle(char[] text)
protected void handleComment(char[] text)
protected void handleEOFInComment()
protected void handleEmptyTag(TagElement tag) throws ChangedCharSetException
protected void handleStartTag(TagElement tag)
protected void handleEndTag(TagElement tag)
protected void handleError(int ln, String msg)
protected void error(String err, String arg1, String arg2, String arg3)
protected void error(String err, String arg1, String arg2)
protected void error(String err, String arg1)
protected void error(String err)
protected void startTag(TagElement tag) throws ChangedCharSetException
protected void endTag(boolean omitted)
protected void markFirstTime(Element elem)
public String parseDTDMarkup() throws IOException
protected boolean parseMarkupDeclarations(StringBuffer strBuff) throws IOException
public void parse(Reader in) throws IOException
protected int getCurrentPos()
|
Java プラットフォーム 1.2 |
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 内部クラス | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |