クラスHTMLWriter

java.lang.Object
javax.swing.text.AbstractWriter
javax.swing.text.html.HTMLWriter

public class HTMLWriter extends AbstractWriter
HTMLDocumentのライターです。
  • フィールドのサマリー

    クラスで宣言されたフィールド AbstractWriter

    NEWLINE
    修飾子と型
    フィールド
    説明
    protected static final char
    テキスト・パッケージ・モデルの改行法です。
  • コンストラクタのサマリー

    コンストラクタ
    コンストラクタ
    説明
    新しいHTMLWriterを作成します。
    HTMLWriter(Writer w, HTMLDocument doc, int pos, int len)
    新しいHTMLWriterを作成します。
  • メソッドのサマリー

    修飾子と型
    メソッド
    説明
    protected void
    属性セットおよびタグ・ベクターに格納された各タグを検索します。
    protected void
    コメントを書き出します。
    protected void
    すべての空要素(対応する終了タグのないタグすべて)を書き出します。
    protected void
    要素の終了タグを書き出します。
    protected boolean
    要素に対応するHTMLタグがblockタグかどうかを判定します。
    protected boolean
    StyleConstants.NameAttributeがパラメータとして渡されるタグに等しい場合はtrueを返します。
    protected void
    output(char[] chars, int start, int length)
    このメソッドは、<から& lt;などの文字エンティティをマップするためにオーバーライドされます。
    protected void
    SELECTフォーム要素のコンテンツを書き出します。
    protected void
    要素の開始タグを書き出します。
    protected boolean
    要素が合成された要素である場合、trueを返します。
    protected void
    text(Element elem)
    テキストを書き出します。
    protected void
    フォーム要素のTEXTAREAに格納されているテキストを書き出します。
    void
    要素ツリーで反復され、すべてのタグとその属性の書込みを制御します。
    protected void
    属性セットを書き出します。
    protected void
    AttributeSetで組込みタグを検索してそれを書き出します。
    protected void
    行区切り文字を書き出します。
    protected void
    Optionフォーム要素のコンテンツを書き出します。

    クラスで宣言されたメソッド 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
    修飾子と型
    メソッド
    説明
    protected void
    インデント・レベルを減分します。
    protected boolean
    行がラップ可能かどうかを返します。
    protected int
    現在の行の長さを返します。
    protected Document
    ドキュメントを取得します。
    protected ElementIterator
    ElementIteratorを取得します。
    int
    出力対象の最後のオフセットを返します。
    protected int
    現在のインデント・レベルを返します。
    protected int
    インデントするスペースの量を返します。
    protected int
    行の長さの最大値を返します。
    改行を表すときに使用する文字列を返します。
    int
    出力対象の最初のオフセットを返します。
    protected String
    要素に関連したテキストを返します。
    protected Writer
    コンテンツを出力するときに使用するライターを返します。
    protected void
    インデント・レベルを増分します。
    protected void
    インデントを行います。
    protected boolean
    このメソッドは、現在の要素が指定された範囲内にあるかどうかを判定します。
    protected boolean
    現在の行の長さが空の場合は、trueを返します。
    protected void
    setCanWrapLines(boolean newValue)
    行をラップできるかどうかを設定します。
    protected void
    現在の行の長さを設定します。
    protected void
    setIndentSpace(int space)
    インデントにマッピングするスペースの数をサブクラスから指定できるようにします。
    protected void
    1行あたりに書き込むことのできる文字数をサブクラスから設定できるようにします。
    void
    改行を表すときに使用する文字列を設定します。
    protected void
    write(char ch)
    文字を書き出します。
    protected void
    write(char[] chars, int startIndex, int length)
    すべての書出しメソッドはこれを呼び出します。
    protected void
    write(String content)
    文字列を書き出します。

    クラスオブジェクトで宣言されたメソッド

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    修飾子と型
    メソッド
    説明
    protected Object
    このオブジェクトのコピーを作成して、返します。
    boolean
    このオブジェクトと他のオブジェクトが等しいかどうかを示します。
    protected void
    削除予定のため非推奨: このAPI要素は、将来のバージョンで削除される可能性があります。
    最終決定は非推奨であり、将来のリリースで削除される可能性があります。
    final Class<?>
    このObjectの実行時クラスを返します。
    int
    このオブジェクトに対するハッシュ・コード値を返します。
    final void
    このオブジェクトのモニターで待機中のスレッドを1つ再開します。
    final void
    このオブジェクトのモニターで待機中のすべてのスレッドを再開します。
    オブジェクトの文字列表現を返します。
    final void
    現在のスレッドが目覚めるまで待機します。通常、notifiedまたはinterruptedです。
    final void
    wait(long timeoutMillis)
    現在のスレッドは、通常、notifiedまたはinterruptedであるか、一定のリアルタイムが経過するまで、目覚めるまで待機します。
    final void
    wait(long timeoutMillis, int nanos)
    現在のスレッドは、通常、notifiedまたはinterruptedであるか、一定のリアルタイムが経過するまで、目覚めるまで待機します。
  • コンストラクタの詳細

    • 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
      要素ツリーで反復され、すべてのタグとその属性の書込みを制御します。
      定義:
      write、クラスAbstractWriter
      スロー:
      IOException - 入出力エラーが発生した場合
      BadLocationException - posがドキュメント内の無効な位置を表す場合。
    • writeAttributes

      protected void writeAttributes(AttributeSet attr) throws IOException
      属性セットを書き出します。 HTML.Tag型のキーを持つ属性、StyleConstants型のキーを持つ属性、およびHTML.Attribute.ENDTAG型のキーを持つ属性はすべて無視します。
      オーバーライド:
      writeAttributes、クラスAbstractWriter
      パラメータ:
      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 - posがドキュメント内の無効な位置を表す場合。
    • textAreaContent

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

      protected void text(Element elem) throws BadLocationException, IOException
      テキストを書き出します。 コンストラクタの呼出し時に範囲が指定されている場合は、対応する範囲のテキストだけが書き出されます。
      オーバーライド:
      text、クラスAbstractWriter
      パラメータ:
      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を暗示したタグだけです。
      パラメータ:
      elem - 要素
      戻り値:
      要素が合成要素の場合はtrue
    • matchNameAttribute

      protected boolean matchNameAttribute(AttributeSet attr, HTML.Tag tag)
      StyleConstants.NameAttributeがパラメータとして渡されるタグに等しい場合はtrueを返します。
      パラメータ:
      attr - 属性のセット
      tag - HTMLタグ
      戻り値:
      StyleConstants.NameAttributeがパラメータとして渡されるタグと等しい場合はtrue
    • writeEmbeddedTags

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

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

      protected void writeLineSeparator() throws IOException
      行区切り文字を書き出します。 これは、改行内容が通常のascii以外の場合に置換されないようにするためにオーバーライドされます。
      オーバーライド:
      writeLineSeparator、クラスAbstractWriter
      スロー:
      IOException - 入出力エラーが発生した場合
      導入されたバージョン:
      1.3
    • output

      protected void output(char[] chars, int start, int length) throws IOException
      このメソッドは、<から& lt;などの文字エンティティをマップするためにオーバーライドされます。コンテンツを書き込むためにsuper.outputが起動されます。
      オーバーライド:
      output、クラスAbstractWriter
      パラメータ:
      chars - 出力する文字
      start - 開始インデックス
      length - 出力の長さ
      スロー:
      IOException - 入出力エラーが発生した場合
      導入されたバージョン:
      1.3