JavaTM Platform
Standard Ed. 6

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 output(char[] chars, int start, int length)
          このメソッドは、文字エンティティーをマッピングするためにオーバーライドされます (< と &lt; など)。
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 writeAttributes(AttributeSet attr)
          属性セットを書き出します。
protected  void writeEmbeddedTags(AttributeSet attr)
          AttributeSet で組み込みタグを検索してそれを書き出します。
protected  void writeLineSeparator()
          行区切り文字を書き出します。
protected  void writeOption(Option option)
          Option フォーム要素のコンテンツを書き出します。
 
クラス javax.swing.text.AbstractWriter から継承されたメソッド
decrIndent, getCanWrapLines, getCurrentLineLength, getDocument, getElementIterator, getEndOffset, getIndentLevel, getIndentSpace, getLineLength, getLineSeparator, getStartOffset, getText, getWriter, incrIndent, indent, inRange, isLineEmpty, setCanWrapLines, setCurrentLineLength, setIndentSpace, setLineLength, setLineSeparator, write, write, write
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

HTMLWriter

public HTMLWriter(Writer w,
                  HTMLDocument doc)
新しい HTMLWriter を作成します。

パラメータ:
w - Writer
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
要素ツリーで反復され、すべてのタグとその属性の書き込みを制御します。

定義:
クラス AbstractWriter 内の write
例外:
IOException - 入出力エラーが発生した場合
BadLocationException - pos がドキュメント内の 無効な位置を表す場合

writeAttributes

protected void writeAttributes(AttributeSet attr)
                        throws IOException
属性セットを書き出します。HTML.Tag 型のキーを持つ属性、StyleConstants 型のキーを持つ属性、および HTML.Attribute.ENDTAG 型のキーを持つ属性はすべて無視します。

オーバーライド:
クラス AbstractWriter 内の writeAttributes
パラメータ:
attr - AttributeSet
例外:
IOException - 入出力エラーが発生した場合

emptyTag

protected void emptyTag(Element elem)
                 throws BadLocationException,
                        IOException
すべての空要素 (対応する終了タグのないタグすべて) を書き出します。

パラメータ:
elem - Element
例外:
IOException - 入出力エラーが発生した場合
BadLocationException - pos がドキュメント内の 無効な位置を表す場合

isBlockTag

protected boolean isBlockTag(AttributeSet attr)
要素に対応する HTML タグが block タグかどうかを判定します。

パラメータ:
attr - AttributeSet
戻り値:
タグが block タグの場合は true、そうでない場合は false

startTag

protected void startTag(Element elem)
                 throws IOException,
                        BadLocationException
要素の開始タグを書き出します。すべての合成要素を無視します。

パラメータ:
elem - Element
例外:
IOException - 入出力エラーが発生した場合
BadLocationException

textAreaContent

protected void textAreaContent(AttributeSet attr)
                        throws BadLocationException,
                               IOException
フォーム要素の TEXTAREA に格納されているテキストを書き出します。

パラメータ:
attr - AttributeSet
例外:
IOException - 入出力エラーが発生した場合
BadLocationException - pos がドキュメント内の 無効な位置を表す場合

text

protected void text(Element elem)
             throws BadLocationException,
                    IOException
テキストを書き出します。コンストラクタの呼び出し時に範囲が指定されている場合は、対応する範囲のテキストだけが書き出されます。

オーバーライド:
クラス AbstractWriter 内の text
パラメータ:
elem - Element
例外:
IOException - 入出力エラーが発生した場合
BadLocationException - pos がドキュメント内の 無効な位置を表す場合

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 - Element
例外:
IOException - 入出力エラーが発生した場合

comment

protected void comment(Element elem)
                throws BadLocationException,
                       IOException
コメントを書き出します。

パラメータ:
elem - Element
例外:
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 - 入出力エラーが発生した場合

writeLineSeparator

protected void writeLineSeparator()
                           throws IOException
行区切り文字を書き出します。改行コンテンツが標準 ascii でない場合には置換しないように、オーバーライドされます。

オーバーライド:
クラス AbstractWriter 内の writeLineSeparator
例外:
IOException
導入されたバージョン:
1.3

output

protected void output(char[] chars,
                      int start,
                      int length)
               throws IOException
このメソッドは、文字エンティティーをマッピングするためにオーバーライドされます (< と &lt; など)。コンテンツを書き込むために super.output が呼び出されます。

オーバーライド:
クラス AbstractWriter 内の output
例外:
IOException
導入されたバージョン:
1.3

JavaTM Platform
Standard Ed. 6

バグの報告と機能のリクエスト
さらに詳しい API リファレンスおよび開発者ドキュメントについては、Java SE 開発者用ドキュメントを参照してください。開発者向けの詳細な解説、概念の概要、用語の定義、バグの回避策、およびコード実例が含まれています。

Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。