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