- 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 voidcloseOutUnwantedEmbeddedTags(AttributeSet attr)属性セットおよびタグ・ベクターに格納された各タグを検索します。protected voidcomment(Element elem)コメントを書き出します。protected voidemptyTag(Element elem)すべての空要素(対応する終了タグのないタグすべて)を書き出します。protected voidendTag(Element elem)要素の終了タグを書き出します。protected booleanisBlockTag(AttributeSet attr)要素に対応するHTMLタグがblockタグかどうかを判定します。protected booleanmatchNameAttribute(AttributeSet attr, HTML.Tag tag)StyleConstants.NameAttributeがパラメータとして渡されるタグに等しい場合はtrueを返します。protected voidoutput(char[] chars, int start, int length)このメソッドは、< などの文字エンティティを< にマッピングするためにオーバーライドされます。protected voidselectContent(AttributeSet attr)SELECTフォーム要素のコンテンツを書き出します。protected voidstartTag(Element elem)要素の開始タグを書き出します。protected booleansynthesizedElement(Element elem)要素が合成要素の場合はtrueを返します。protected voidtext(Element elem)テキストを書き出します。protected voidtextAreaContent(AttributeSet attr)フォーム要素のTEXTAREAに格納されているテキストを書き出します。voidwrite()要素ツリーで反復され、すべてのタグとその属性の書込みを制御します。protected voidwriteAttributes(AttributeSet attr)属性セットを書き出します。protected voidwriteEmbeddedTags(AttributeSet attr)AttributeSetで組込みタグを検索してそれを書き出します。protected voidwriteLineSeparator()行区切り文字を書き出します。protected voidwriteOption(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
 
- 
 
- 
- 
- 
コンストラクタの詳細- 
HTMLWriterpublic HTMLWriter(Writer w, HTMLDocument doc) 新しいHTMLWriterを作成します。- パラメータ:
- w- Writer
- doc- HTMLDocument
 
 - 
HTMLWriterpublic HTMLWriter(Writer w, HTMLDocument doc, int pos, int len) 新しいHTMLWriterを作成します。- パラメータ:
- w- Writer
- doc- HTMLDocument
- pos- コンテンツを取得するドキュメントの位置
- len- 書き出す量
 
 
- 
 - 
メソッドの詳細- 
writepublic void write() throws IOException, BadLocationException要素ツリーで反復され、すべてのタグとその属性の書込みを制御します。- 定義:
- write、クラス:- AbstractWriter
- 例外:
- IOException- 入出力エラーが発生した場合
- BadLocationException- posがドキュメント内の無効な位置を表す場合。
 
 - 
writeAttributesprotected void writeAttributes(AttributeSet attr) throws IOException 属性セットを書き出します。 HTML.Tag型のキーを持つ属性、StyleConstants型のキーを持つ属性、およびHTML.Attribute.ENDTAG型のキーを持つ属性はすべて無視します。- オーバーライド:
- writeAttributes、クラス:- AbstractWriter
- パラメータ:
- attr- AttributeSet
- 例外:
- IOException- 入出力エラーが発生した場合
 
 - 
emptyTagprotected void emptyTag(Element elem) throws BadLocationException, IOException すべての空要素(対応する終了タグのないタグすべて)を書き出します。- パラメータ:
- elem- Element
- 例外:
- IOException- 入出力エラーが発生した場合
- BadLocationException- posがドキュメント内の無効な位置を表す場合。
 
 - 
isBlockTagprotected boolean isBlockTag(AttributeSet attr) 要素に対応するHTMLタグがblockタグかどうかを判定します。- パラメータ:
- attr- AttributeSet
- 戻り値:
- タグがblockタグの場合はtrue、そうでない場合はfalse
 
 - 
startTagprotected void startTag(Element elem) throws IOException, BadLocationException 要素の開始タグを書き出します。 すべての合成要素を無視します。- パラメータ:
- elem- Element
- 例外:
- IOException- 入出力エラーが発生した場合
- BadLocationException- posがドキュメント内の無効な位置を表す場合。
 
 - 
textAreaContentprotected void textAreaContent(AttributeSet attr) throws BadLocationException, IOException フォーム要素のTEXTAREAに格納されているテキストを書き出します。- パラメータ:
- attr- AttributeSet
- 例外:
- IOException- 入出力エラーが発生した場合
- BadLocationException- posがドキュメント内の無効な位置を表す場合。
 
 - 
textprotected void text(Element elem) throws BadLocationException, IOException テキストを書き出します。 コンストラクタの呼出し時に範囲が指定されている場合は、対応する範囲のテキストだけが書き出されます。- オーバーライド:
- text、クラス:- AbstractWriter
- パラメータ:
- elem- Element
- 例外:
- IOException- 入出力エラーが発生した場合
- BadLocationException- posがドキュメント内の無効な位置を表す場合。
 
 - 
selectContentprotected void selectContent(AttributeSet attr) throws IOException SELECTフォーム要素のコンテンツを書き出します。- パラメータ:
- attr- フォーム要素に関連したAttributeSet
- 例外:
- IOException- 入出力エラーが発生した場合
 
 - 
writeOptionprotected void writeOption(Option option) throws IOException Optionフォーム要素のコンテンツを書き出します。- パラメータ:
- option- Option
- 例外:
- IOException- 入出力エラーが発生した場合
 
 - 
endTagprotected void endTag(Element elem) throws IOException 要素の終了タグを書き出します。- パラメータ:
- elem- Element
- 例外:
- IOException- 入出力エラーが発生した場合
 
 - 
commentprotected void comment(Element elem) throws BadLocationException, IOException コメントを書き出します。- パラメータ:
- elem- Element
- 例外:
- IOException- 入出力エラーが発生した場合
- BadLocationException- posがドキュメント内の無効な位置を表す場合。
 
 - 
synthesizedElementprotected boolean synthesizedElement(Element elem) 要素が合成要素の場合はtrueを返します。 現時点では、調べる対象はpを暗示したタグだけです。- パラメータ:
- elem- 要素
- 戻り値:
- 要素が合成要素の場合はtrue。
 
 - 
matchNameAttributeprotected boolean matchNameAttribute(AttributeSet attr, HTML.Tag tag) StyleConstants.NameAttributeがパラメータとして渡されるタグに等しい場合はtrueを返します。- パラメータ:
- attr- 属性のセット
- tag- HTMLタグ
- 戻り値:
- trueStyleConstants.NameAttributeがパラメータとして渡されたタグと等しい場合。
 
 - 
writeEmbeddedTagsprotected void writeEmbeddedTags(AttributeSet attr) throws IOException AttributeSetで組込みタグを検索してそれを書き出します。 また、必要に応じて対応する終了タグを書出せるように、これらのタグをベクターに格納します。- パラメータ:
- attr- 属性のセット
- 例外:
- IOException- 入出力エラーが発生した場合
 
 - 
closeOutUnwantedEmbeddedTagsprotected void closeOutUnwantedEmbeddedTags(AttributeSet attr) throws IOException 属性セットおよびタグ・ベクターに格納された各タグを検索します。 タグが見つからなければ、ベクターのタグを削除して対応する終了タグを書き出します。- パラメータ:
- attr- 属性のセット
- 例外:
- IOException- 入出力エラーが発生した場合
 
 - 
writeLineSeparatorprotected void writeLineSeparator() throws IOException行区切り文字を書き出します。 改行コンテンツが標準asciiでない場合には置換しないように、オーバーライドされます。- オーバーライド:
- writeLineSeparator、クラス:- AbstractWriter
- 例外:
- IOException- 入出力エラーが発生した場合
- 導入されたバージョン:
- 1.3
 
 - 
outputprotected void output(char[] chars, int start, int length) throws IOExceptionこのメソッドは、文字エンティティをマッピングするためにオーバーライドされます(< と< など)。コンテンツを書き込むためにsuper.outputが呼び出されます。- オーバーライド:
- output、クラス:- AbstractWriter
- パラメータ:
- chars- 出力する文字
- start- 開始インデックス
- length- 出力の長さ
- 例外:
- IOException- 入出力エラーが発生した場合
- 導入されたバージョン:
- 1.3
 
 
- 
 
-