- 導入されたバージョン:
- 1.6
- 関連項目:
-
コンストラクタのサマリー
コンストラクタ -
メソッドのサマリー
修飾子と型メソッド説明abstract AttributecreateAttribute(String localName, String value) 新しいAttributeを作成します。abstract AttributecreateAttribute(String prefix, String namespaceURI, String localName, String value) 新しいAttributeを作成します。abstract AttributecreateAttribute(QName name, String value) 新しいAttributeを作成します。abstract CharacterscreateCData(String content) CDataフラグがtrueに設定されているCharactersイベントを作成します。abstract CharacterscreateCharacters(String content) Charactersイベントを作成します。このメソッドは、内容がすべて空白文字であるかどうかをチェックしません。abstract CommentcreateComment(String text) コメントを作成します。abstract DTD文書型定義イベントを作成します。この文字列には、XML 1.0仕様のdoctypedeclに一致する文書型宣言のすべてが含まれます。abstract EndDocumentEndDocumentイベントの新しいインスタンスを作成します。abstract EndElementcreateEndElement(String prefix, String namespaceUri, String localName) 新しいEndElementを作成します。abstract EndElementcreateEndElement(String prefix, String namespaceUri, String localName, Iterator<? extends Namespace> namespaces) 新しいEndElementを作成します。abstract EndElementcreateEndElement(QName name, Iterator<? extends Namespace> namespaces) 新しいEndElementを作成します。abstract EntityReferencecreateEntityReference(String name, EntityDeclaration declaration) EntityReferenceイベントの新しいインスタンスを作成します。abstract CharacterscreateIgnorableSpace(String content) 無視できる空白を作成します。abstract NamespacecreateNamespace(String namespaceURI) 新しいデフォルトのNamespaceを作成します。abstract NamespacecreateNamespace(String prefix, String namespaceUri) 新しいNamespaceを作成します。abstract ProcessingInstructioncreateProcessingInstruction(String target, String data) 処理命令を作成します。abstract CharacterscreateSpace(String content) isSpaceフラグがtrueに設定されているCharactersイベントを作成します。abstract StartDocumentStartDocumentイベントの新しいインスタンスを作成します。abstract StartDocumentcreateStartDocument(String encoding) StartDocumentイベントの新しいインスタンスを作成します。abstract StartDocumentcreateStartDocument(String encoding, String version) StartDocumentイベントの新しいインスタンスを作成します。abstract StartDocumentcreateStartDocument(String encoding, String version, boolean standalone) StartDocumentイベントの新しいインスタンスを作成します。abstract StartElementcreateStartElement(String prefix, String namespaceUri, String localName) 新しいStartElementを作成します。abstract StartElementcreateStartElement(String prefix, String namespaceUri, String localName, Iterator<? extends Attribute> attributes, Iterator<? extends Namespace> namespaces) 新しいStartElementを作成します。abstract StartElementcreateStartElement(String prefix, String namespaceUri, String localName, Iterator<? extends Attribute> attributes, Iterator<? extends Namespace> namespaces, NamespaceContext context) 新しいStartElementを作成します。abstract StartElementcreateStartElement(QName name, Iterator<? extends Attribute> attributes, Iterator<? extends Namespace> namespaces) 新しいStartElementを作成します。static XMLEventFactoryXMLEventFactory組み込みシステムのデフォルト実装の新しいインスタンスを作成します。static XMLEventFactoryファクトリの新しいインスタンスを作成します。static XMLEventFactorynewFactory(String factoryId, ClassLoader classLoader) ファクトリの新しいインスタンスを作成します。static XMLEventFactorynewFactory()メソッドとまったく同様にファクトリの新しいインスタンスを作成します。static XMLEventFactorynewInstance(String factoryId, ClassLoader classLoader) 非推奨。APIの整合性を維持するために、このメソッドは非推奨になりました。abstract voidsetLocation(Location location) このメソッドを使用すると、このファクトリによって作成された各イベントでLocationを設定できます。
-
コンストラクタの詳細
-
XMLEventFactory
protected XMLEventFactory()インスタンス化を妨げるprotectedコンストラクタです。 代わりにnewFactory()を使用してください。
-
-
メソッドの詳細
-
newDefaultFactory
public static XMLEventFactory newDefaultFactory()XMLEventFactory組み込みシステムのデフォルト実装の新しいインスタンスを作成します。- 戻り値:
XMLEventFactory組み込みシステムのデフォルト実装の新しいインスタンス。- 導入されたバージョン:
- 9
-
newInstance
public static XMLEventFactory newInstance() throws FactoryConfigurationErrornewFactory()メソッドとまったく同様にファクトリの新しいインスタンスを作成します。- 戻り値:
XMLEventFactoryのインスタンス- 例外:
FactoryConfigurationError- このファクトリのインスタンスをロードできない場合
-
newFactory
public static XMLEventFactory newFactory() throws FactoryConfigurationErrorファクトリの新しいインスタンスを作成します。 このメソッドは、「JAXPルックアップ・メカニズム」を使用して、ロードするXMLEventFactory実装クラスを決定します。アプリケーションが
XMLEventFactoryへの参照を取得すると、ファクトリを使用してストリーム・インスタンスを構成および取得できます。- 戻り値:
XMLEventFactoryのインスタンス- 例外:
FactoryConfigurationError- サービス構成エラーが発生した場合、または実装が使用できないかインスタンス化できない場合。
-
newInstance
@Deprecated(since="1.7") public static XMLEventFactory newInstance(String factoryId, ClassLoader classLoader) throws FactoryConfigurationError 非推奨。APIの整合性を維持するために、このメソッドは非推奨になりました。 すべてのnewInstanceメソッドが、対応するnewFactoryメソッドに置き換えられています。 代替のnewFactory(java.lang.String, java.lang.ClassLoader)メソッドでは、動作の変更は定義されていません。ファクトリの新しいインスタンスを作成します。- パラメータ:
factoryId- 検索するファクトリの名前。プロパティ名と同一classLoader- 使用するclassLoader- 戻り値:
- ファクトリの実装
- 例外:
FactoryConfigurationError- このファクトリのインスタンスをロードできない場合
-
newFactory
public static XMLEventFactory newFactory(String factoryId, ClassLoader classLoader) throws FactoryConfigurationError ファクトリの新しいインスタンスを作成します。 classLoader引数がnullの場合、ContextClassLoaderが使用されます。このメソッドは次の順序の検索手順で、ロードするXMLEventFactory実装クラスを決定します。
-
factoryIdによって識別されるシステム・プロパティの値を使用する。 -
構成ファイル"stax.properties"を使用します。 このファイルは標準の
Properties形式であり、通常Javaインストールのconfディレクトリにあります。 これには、実装クラスの完全修飾名が格納されています。stax.propertiesファイルは実装によって一度だけ読み込まれ、その値は将来の使用のためにキャッシュされます。 最初の読込み時にファイルが存在しないと、そのあとにその存在がチェックされることはない。 stax.propertiesが最初に読み込まれた後に、そのプロパティの値を変更することはできません。
jaxp構成ファイル"jaxp.properties"を使用します。 このファイルはstax.propertiesと同じ形式であり、stax.propertiesが存在しない場合にのみ読み込まれます。
-
factoryIdが"javax.xml.stream.XMLEventFactory"の場合は、ServiceLoaderクラスで定義されているサービス・プロバイダ・ロード機能を使用して、指定されたClassLoaderを使用してサービスの実装を「見つけて読み込む」しようとします。classLoaderがnullである場合、デフォルトのロード・メカニズムが適用される。つまり、サービス・プロバイダのロード機能は、現在のスレッドのコンテキスト・クラス・ローダーを使用してサービスのロードを試みる。 コンテキスト・クラス・ローダーがnullの場合、システム・クラス・ローダーが使用されます。 -
それ以外の場合は、
FactoryConfigurationErrorをスローする。
これは非推奨の
newInstance(String factoryId、ClassLoader classLoader)メソッドを置き換える新しいメソッドです。 非推奨のメソッドに関連して、この置換メソッドによって定義されている動作に変更はありません。- APIのノート:
- ここで定義されているパラメータfactoryIdは、最初のパラメータがファクトリの実装を提供する完全修飾ファクトリ・クラス名である、他のJAXPファクトリのfactoryIdとは一致しません。
- パラメータ:
factoryId- 検索するファクトリの名前。プロパティ名と同一classLoader- 使用するclassLoader- 戻り値:
- ファクトリの実装
- 例外:
FactoryConfigurationError- サービス構成エラーが発生した場合、または実装が使用できないかインスタンス化できない場合。
-
-
setLocation
public abstract void setLocation(Location location) このメソッドを使用すると、このファクトリによって作成された各イベントでLocationを設定できます。 これらの値は、このファクトリによって作成されたイベントに値コピーされます。 位置情報をリセットするには、位置をnullに設定します。- パラメータ:
location- 作成されるイベントごとに設定する位置
-
createAttribute
public abstract Attribute createAttribute(String prefix, String namespaceURI, String localName, String value) 新しいAttributeを作成します。- パラメータ:
prefix- この属性の接頭辞。null以外namespaceURI- 属性値はこの値に設定される。null以外localName- 属性のXML名のローカル名。localNameをnullにすることはできないvalue- 設定される属性値。null以外- 戻り値:
- 指定した値を持つAttribute
-
createAttribute
新しいAttributeを作成します。- パラメータ:
localName- 属性のXML名のローカル名。localNameをnullにすることはできないvalue- 設定される属性値。null以外- 戻り値:
- 指定した値を持つAttribute
-
createAttribute
新しいAttributeを作成します。- パラメータ:
name- 属性の修飾名。null以外value- 設定される属性値。null以外- 戻り値:
- 指定した値を持つAttribute
-
createNamespace
新しいデフォルトのNamespaceを作成します。- パラメータ:
namespaceURI- デフォルトの名前空間URI- 戻り値:
- 指定された値を持つNamespace
-
createNamespace
新しいNamespaceを作成します。- パラメータ:
prefix- この名前空間の接頭辞。null以外namespaceUri- 属性値はこの値に設定される。null以外- 戻り値:
- 指定された値を持つNamespace
-
createStartElement
public abstract StartElement createStartElement(QName name, Iterator<? extends Attribute> attributes, Iterator<? extends Namespace> namespaces) 新しいStartElementを作成します。 Namespaceインタフェースのセットを順次処理するイテレータを渡すことで、NamespaceをこのStartElementに追加できます。 Attributeインタフェースのセットを順次処理するイテレータを渡すことで、AttributeをこのStartElementに追加できます。- パラメータ:
name- 属性の修飾名。null以外attributes- 新しいStartElementに追加するAttributeを実装するオブジェクトの順序付けされていないオプション・セット。nullの場合もあるnamespaces- 新しいStartElementに追加するNamespaceを実装するオブジェクトの順序付けされていないオプション・セット。nullの場合もある- 戻り値:
- 要求されたStartElementのインスタンス
-
createStartElement
public abstract StartElement createStartElement(String prefix, String namespaceUri, String localName) 新しいStartElementを作成します。 NamespaceContextのデフォルトを空のNamespaceContextに設定します。 このイベントを名前空間または属性で照会すると、空のイテレータが返されます。- パラメータ:
prefix- 新しいStartElementのQNameの接頭辞namespaceUri- 新しいStartElementのQNameのURIlocalName- 新しいStartElementのQNameのローカル名- 戻り値:
- 要求されたStartElementのインスタンス
-
createStartElement
public abstract StartElement createStartElement(String prefix, String namespaceUri, String localName, Iterator<? extends Attribute> attributes, Iterator<? extends Namespace> namespaces) 新しいStartElementを作成します。 Namespaceインタフェースのセットを順次処理するイテレータを渡すことで、NamespaceをこのStartElementに追加できます。 Attributeインタフェースのセットを順次処理するイテレータを渡すことで、AttributeをこのStartElementに追加できます。- パラメータ:
prefix- 新しいStartElementのQNameの接頭辞namespaceUri- 新しいStartElementのQNameのURIlocalName- 新しいStartElementのQNameのローカル名attributes- 新しいStartElementに追加するAttributeを実装するオブジェクトの順序付けされていないセットnamespaces- 新しいStartElementに追加するNamespaceを実装するオブジェクトの順序付けされていないセット- 戻り値:
- 要求されたStartElementのインスタンス
-
createStartElement
public abstract StartElement createStartElement(String prefix, String namespaceUri, String localName, Iterator<? extends Attribute> attributes, Iterator<? extends Namespace> namespaces, NamespaceContext context) 新しいStartElementを作成します。 Namespaceインタフェースのセットを順次処理するイテレータを渡すことで、NamespaceをこのStartElementに追加できます。 Attributeインタフェースのセットを順次処理するイテレータを渡すことで、AttributeをこのStartElementに追加できます。- パラメータ:
prefix- 新しいStartElementのQNameの接頭辞namespaceUri- 新しいStartElementのQNameのURIlocalName- 新しいStartElementのQNameのローカル名attributes- 新しいStartElementに追加するAttributeを実装するオブジェクトの順序付けされていないセット。nullの場合もあるnamespaces- 新しいStartElementに追加するNamespaceを実装するオブジェクトの順序付けされていないセット。nullの場合もあるcontext- この要素の名前空間コンテキスト- 戻り値:
- 要求されたStartElementのインスタンス
-
createEndElement
public abstract EndElement createEndElement(QName name, Iterator<? extends Namespace> namespaces) 新しいEndElementを作成します。- パラメータ:
name- EndElementの修飾名namespaces- 範囲外になったNamespaceを実装するオブジェクトの順序付けされていないオプション・セット。nullの場合もある- 戻り値:
- 要求されたEndElementのインスタンス
-
createEndElement
public abstract EndElement createEndElement(String prefix, String namespaceUri, String localName) 新しいEndElementを作成します。- パラメータ:
prefix- 新しいStartElementのQNameの接頭辞namespaceUri- 新しいStartElementのQNameのURIlocalName- 新しいStartElementのQNameのローカル名- 戻り値:
- 要求されたEndElementのインスタンス
-
createEndElement
public abstract EndElement createEndElement(String prefix, String namespaceUri, String localName, Iterator<? extends Namespace> namespaces) 新しいEndElementを作成します。- パラメータ:
prefix- 新しいStartElementのQNameの接頭辞namespaceUri- 新しいStartElementのQNameのURIlocalName- 新しいStartElementのQNameのローカル名namespaces- 範囲外になったNamespaceを実装するオブジェクトの順序付けされていないセット。nullの場合もある- 戻り値:
- 要求されたEndElementのインスタンス
-
createCharacters
public abstract Characters createCharacters(String content) Charactersイベントを作成します。このメソッドは、内容がすべて空白文字であるかどうかをチェックしません。 空白イベントを作成するには、#createSpace(String)を使用します- パラメータ:
content- 作成する文字列- 戻り値:
- Charactersイベント
-
createCData
public abstract Characters createCData(String content) CDataフラグがtrueに設定されているCharactersイベントを作成します。- パラメータ:
content- 作成する文字列- 戻り値:
- Charactersイベント
-
createSpace
public abstract Characters createSpace(String content) isSpaceフラグがtrueに設定されているCharactersイベントを作成します。- パラメータ:
content- 作成する空白の内容- 戻り値:
- Charactersイベント
-
createIgnorableSpace
public abstract Characters createIgnorableSpace(String content) 無視できる空白を作成します。- パラメータ:
content- 作成する空白- 戻り値:
- Charactersイベント
-
createStartDocument
public abstract StartDocument createStartDocument()StartDocumentイベントの新しいインスタンスを作成します。- 戻り値:
- StartDocumentイベント
-
createStartDocument
public abstract StartDocument createStartDocument(String encoding, String version, boolean standalone) StartDocumentイベントの新しいインスタンスを作成します。- パラメータ:
encoding- エンコーディング形式version- XMLバージョンstandalone- スタンドアロンの状態はtrueまたはfalseに設定される- 戻り値:
- StartDocumentイベント
-
createStartDocument
public abstract StartDocument createStartDocument(String encoding, String version) StartDocumentイベントの新しいインスタンスを作成します。- パラメータ:
encoding- エンコーディング形式version- XMLバージョン- 戻り値:
- StartDocumentイベント
-
createStartDocument
public abstract StartDocument createStartDocument(String encoding) StartDocumentイベントの新しいインスタンスを作成します。- パラメータ:
encoding- エンコーディング形式- 戻り値:
- StartDocumentイベント
-
createEndDocument
public abstract EndDocument createEndDocument()EndDocumentイベントの新しいインスタンスを作成します。- 戻り値:
- EndDocumentイベント
-
createEntityReference
public abstract EntityReference createEntityReference(String name, EntityDeclaration declaration) EntityReferenceイベントの新しいインスタンスを作成します。- パラメータ:
name- 参照の名前declaration- イベントの宣言- 戻り値:
- EntityReferenceイベント
-
createComment
コメントを作成します。- パラメータ:
text- コメントのテキスト- 戻り値:
- コメント・イベント
-
createProcessingInstruction
public abstract ProcessingInstruction createProcessingInstruction(String target, String data) 処理命令を作成します。- パラメータ:
target- 処理命令のターゲットdata- 処理命令のテキスト- 戻り値:
- ProcessingInstructionイベント
-
createDTD
文書型定義イベントを作成します。この文字列には、XML 1.0仕様のdoctypedeclに一致する文書型宣言のすべてが含まれます。- パラメータ:
dtd- 文書型定義のテキスト- 戻り値:
- DTDイベント
-