public class Attributes2Impl extends AttributesImpl implements Attributes2
Attributes2 インタフェースを実装して、Attributes 情報を追加する SAX2 拡張ヘルパー。
このモジュールは、ソースコード、文書ともに公開ドメインに置かれています。したがって、内容に関する保証は一切提供されません。
これは、SAX2 コアディストリビューションだけに含まれるものではありません。
各属性の specified フラグは、コピーコンストラクタで false に設定されるか setSpecified(int, boolean) を使用して false に設定されないかぎり常に true です。同様に、各属性の declared フラグは、デフォルトに設定された属性 (specified は false)、CDATA 以外の属性、または setDeclared(int, boolean) を使用して true に設定された場合を除いて常に false になります。手動によって属性の型を変更する場合は、その declared フラグを一致させるように変更する必要が発生することもあります。
| コンストラクタと説明 |
|---|
Attributes2Impl()
新しい空の Attributes2Impl オブジェクトを構築します。
|
Attributes2Impl(Attributes atts)
既存の Attributes オブジェクトまたは Attributes2 オブジェクトをコピーします。
|
| 修飾子と型 | メソッドと説明 |
|---|---|
void |
addAttribute(String uri, String localName, String qName, String type, String value)
リストの最後に属性を追加し、specified フラグを true に設定します。
|
boolean |
isDeclared(int index)
属性の declared フラグの現在の値を返します。
|
boolean |
isDeclared(String qName)
属性の declared フラグの現在の値を返します。
|
boolean |
isDeclared(String uri, String localName)
属性の declared フラグの現在の値を返します。
|
boolean |
isSpecified(int index)
属性の specified フラグの現在の値を返します。
|
boolean |
isSpecified(String qName)
属性の specified フラグの現在の値を返します。
|
boolean |
isSpecified(String uri, String localName)
属性の specified フラグの現在の値を返します。
|
void |
removeAttribute(int index)
リストから属性を削除します。
|
void |
setAttributes(Attributes atts)
Attributes オブジェクト全体をコピーします。
|
void |
setDeclared(int index, boolean value)
特定の属性の declared フラグに値を割り当てます。
|
void |
setSpecified(int index, boolean value)
特定の属性の specified フラグに値を割り当てます。
|
clear, getIndex, getIndex, getLength, getLocalName, getQName, getType, getType, getType, getURI, getValue, getValue, getValue, setAttribute, setLocalName, setQName, setType, setURI, setValuepublic Attributes2Impl()
public Attributes2Impl(Attributes atts)
このコンストラクタは、特に startElement イベント内で役に立ちます。
atts - 既存の Attributes オブジェクト。public boolean isDeclared(int index)
isDeclared、インタフェース: Attributes2index - 属性インデックス (ゼロから始まる)。public boolean isDeclared(String uri, String localName)
isDeclared、インタフェース: Attributes2uri - 名前空間 URI。名前が名前空間 URI を持たない場合は空文字列。localName - 属性のローカル名。public boolean isDeclared(String qName)
isDeclared、インタフェース: Attributes2qName - XML の接頭辞付きの修飾名。public boolean isSpecified(int index)
isSpecified、インタフェース: Attributes2index - 属性インデックス (ゼロから始まる)。ArrayIndexOutOfBoundsException - 指定されたインデックスが属性を識別しない場合。public boolean isSpecified(String uri, String localName)
isSpecified、インタフェース: Attributes2uri - 名前空間 URI。名前が名前空間 URI を持たない場合は空文字列。localName - 属性のローカル名。IllegalArgumentException - 指定された名前が属性を識別しない場合。public boolean isSpecified(String qName)
isSpecified、インタフェース: Attributes2qName - XML の接頭辞付きの修飾名。IllegalArgumentException - 指定された名前が属性を識別しない場合。public void setAttributes(Attributes atts)
setAttributes、クラス: AttributesImplatts - コピーする属性。AttributesImpl.setAttributes(org.xml.sax.Attributes)public void addAttribute(String uri, String localName, String qName, String type, String value)
setSpecified(int, boolean) を使用します。
属性の type が CDATA でないかぎり、この属性は DTD に宣言されているものとしてマークされます。フラグの値を CDATA 属性に対して true に設定するには setDeclared(int, boolean) を使用します。
addAttribute、クラス: AttributesImpluri - 名前空間 URI。使用可能な名前空間 URI が存在しない場合や、名前空間処理が実行されていない場合は空文字列。localName - ローカル名。名前空間処理が実行されていない場合は空文字列。qName - 接頭辞付きの修飾名。修飾名を使用できない場合は空文字列。type - 属性型を示す文字列。value - 属性値。AttributesImpl.addAttribute(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)public void removeAttribute(int index)
AttributesImplremoveAttribute、クラス: AttributesImplindex - 属性のインデックス (ゼロから始まる)。public void setDeclared(int index,
boolean value)
index - 属性のインデックス (ゼロから始まる)。value - 目的のフラグ値。ArrayIndexOutOfBoundsException - 指定されたインデックスが属性を識別しない場合。AttributesImpl.setType(int, java.lang.String)public void setSpecified(int index,
boolean value)
index - 属性のインデックス (ゼロから始まる)。value - 目的のフラグ値。ArrayIndexOutOfBoundsException - 指定されたインデックスが属性を識別しない場合。 バグまたは機能を送信
詳細な API リファレンスおよび開発者ドキュメントについては、Java SE のドキュメントを参照してください。そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright © 1993, 2013, Oracle and/or its affiliates. All rights reserved.