Java プラットフォーム 1.2

javax.swing.text.html
クラス HTMLWriter

java.lang.Object
  |
  +--javax.swing.text.AbstractWriter
        |
        +--javax.swing.text.html.HTMLWriter

public class HTMLWriter
extends AbstractWriter

HTMLDocument のライターです。


クラス javax.swing.text.AbstractWriter から継承したフィールド
NEWLINE
 
コンストラクタの概要
HTMLWriter(Writer w, HTMLDocument doc)
          新しい HTMLWriter を作成します。
HTMLWriter(Writer w, HTMLDocument doc, int pos, int len)
          新しい HTMLWriter を作成します。
 
メソッドの概要
protected  void closeOutUnwantedEmbeddedTags(AttributeSet attr)
          属性セットおよびタグベクタに格納された各タグを検索します。
protected  void comment(Element elem)
          コメントを書き出します。
protected  void emptyTag(Element elem)
          すべての空要素 (対応する終了タグのないタグ) を書き出します。
protected  void endTag(Element elem)
          要素の終了タグを書き出します。
protected  boolean isBlockTag(AttributeSet attr)
          要素に対応する HTML タグが block タグかどうかを判定します。
protected  boolean matchNameAttribute(AttributeSet attr, HTML.Tag tag)
          StyleConstants.NameAttribute がパラメータとして渡されるタグに等しい場合は true を返します。
protected  void selectContent(AttributeSet attr)
          フォーム要素の SELECT のコンテンツを書き出します。
protected  void startTag(Element elem)
          要素の開始タグを書き出します。
protected  boolean synthesizedElement(Element elem)
          要素が合成要素の場合は true を返します。
protected  void text(Element elem)
          テキストを書き出します。
protected  void textAreaContent(AttributeSet attr)
          フォーム要素の TEXTAREA に格納されているテキストを書き出します。
 void write()
          要素ツリーで反復されてすべてのタグとその属性の書き込みを制御するメソッドです。
protected  void write(String content)
          文字列を書き出します。
protected  void writeAttributes(AttributeSet attr)
          属性セットを書き出します。
protected  void writeEmbeddedTags(AttributeSet attr)
          AttributeSet で組み込みタグを検索してそれを書き出します。
protected  void writeOption(Option option)
          フォーム要素の Option のコンテンツを書き出します。
 
クラス javax.swing.text.AbstractWriter から継承したメソッド
decrIndent, getDocument, getElementIterator, getText, incrIndent, indent, inRange, setIndentSpace, setLineLength, write
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

HTMLWriter

public HTMLWriter(Writer w,
                  HTMLDocument doc)
新しい HTMLWriter を作成します。
パラメータ:
w - ライター
doc - HTMLDocument

HTMLWriter

public HTMLWriter(Writer w,
                  HTMLDocument doc,
                  int pos,
                  int len)
新しい HTMLWriter を作成します。
パラメータ:
w - Writer
doc - HTMLDocument
pos - ドキュメント内でコンテンツを取得する位置
len - 書き出す量
メソッドの詳細

write

public void write()
           throws IOException,
                  BadLocationException
要素ツリーで反復されてすべてのタグとその属性の書き込みを制御するメソッドです。
例外:
IOException - 入出力エラーが発生した場合
BadLocationException - pos がドキュメント内の無効な位置を示す場合
オーバーライド:
クラス AbstractWriter 内の write

writeAttributes

protected void writeAttributes(AttributeSet attr)
                        throws IOException
属性セットを書き出します。キーのタイプが HTML タグであればすべての属性を無視します。
パラメータ:
attr - 属性セット
例外:
IOException - 入出力エラーが発生した場合
オーバーライド:
クラス AbstractWriter 内の writeAttributes

emptyTag

protected void emptyTag(Element elem)
                 throws BadLocationException,
                        IOException
すべての空要素 (対応する終了タグのないタグ) を書き出します。
パラメータ:
elem - 要素
例外:
IOException - 入出力エラーが発生した場合
BadLocationException - pos がドキュメント内の無効な位置を示す場合

isBlockTag

protected boolean isBlockTag(AttributeSet attr)
要素に対応する HTML タグが block タグかどうかを判定します。
パラメータ:
attr - 属性セット
戻り値:
タグが block タグの場合は true、そうでない場合は false

startTag

protected void startTag(Element elem)
                 throws IOException,
                        BadLocationException
要素の開始タグを書き出します。すべての合成要素を無視します。
パラメータ:
elem - 要素
例外:
IOException - 入出力エラーが発生した場合

textAreaContent

protected void textAreaContent(AttributeSet attr)
                        throws BadLocationException,
                               IOException
フォーム要素の TEXTAREA に格納されているテキストを書き出します。
パラメータ:
attr - AttributeSet
例外:
IOException - 入出力エラーが発生した場合
BadLocationException - pos がドキュメント内の無効な位置を示す場合

text

protected void text(Element elem)
             throws BadLocationException,
                    IOException
テキストを書き出します。コンストラクタの呼び出し時に範囲が指定されている場合は、対応する範囲のテキストだけが書き出されます。
パラメータ:
elem - Element
例外:
IOException - 入出力エラーが発生した場合
BadLocationException - pos がドキュメント内の無効な位置を示す場合
オーバーライド:
クラス AbstractWriter 内の text

write

protected void write(String content)
              throws IOException
文字列を書き出します。テキスト領域のコンテンツを書き出す場合は、このメソッドは埋め込まれた改行に対して適切なインデント処理を行います。そうでない場合は、書き込みを処理するためにスーパークラスを呼び出します。
パラメータ:
content - コンテンツの文字列表現
例外:
IOException - 入出力エラーが発生した場合
オーバーライド:
クラス AbstractWriter 内の write

selectContent

protected void selectContent(AttributeSet attr)
                      throws IOException
フォーム要素の SELECT のコンテンツを書き出します。
パラメータ:
attr - フォーム要素に関連付けられた AttributeSet
例外:
IOException - 入出力エラーが発生した場合

writeOption

protected void writeOption(Option option)
                    throws IOException
フォーム要素の Option のコンテンツを書き出します。
パラメータ:
option - Option
例外:
IOException - 入出力エラーが発生した場合

endTag

protected void endTag(Element elem)
               throws IOException
要素の終了タグを書き出します。
パラメータ:
elem - 要素
例外:
IOException - 入出力エラーが発生した場合

comment

protected void comment(Element elem)
                throws BadLocationException,
                       IOException
コメントを書き出します。
パラメータ:
elem - 要素
例外:
IOException - 入出力エラーが発生した場合
BadLocationException - pos がドキュメント内の無効な位置を示す場合

synthesizedElement

protected boolean synthesizedElement(Element elem)
要素が合成要素の場合は true を返します。テストの対象は P タグの効果を内包するタグだけです。

matchNameAttribute

protected boolean matchNameAttribute(AttributeSet attr,
                                     HTML.Tag tag)
StyleConstants.NameAttribute がパラメータとして渡されるタグに等しい場合は true を返します。

writeEmbeddedTags

protected void writeEmbeddedTags(AttributeSet attr)
                          throws IOException
AttributeSet で組み込みタグを検索してそれを書き出します。また、必要に応じて対応する終了タグを書き出せるように、これらのタグをベクタに格納します。
例外:
IOException - 入出力エラーが発生した場合

closeOutUnwantedEmbeddedTags

protected void closeOutUnwantedEmbeddedTags(AttributeSet attr)
                                     throws IOException
属性セットおよびタグベクタに格納された各タグを検索します。タグが見つからなければ、ベクタのタグを削除して対応する終了タグを書き出します。
例外:
IOException - 入出力エラーが発生した場合

Java プラットフォーム 1.2

バグや機能要求の報告
新しい javadoc の表示についてのコメントやご提案
Java は、米国およびその他の国における米国 Sun Microsystems, Inc. の商標もしくは登録商標です。
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.