JavaTM Platform
Standard Ed. 6

javax.xml.stream
クラス XMLEventFactory

java.lang.Object
  上位を拡張 javax.xml.stream.XMLEventFactory

public abstract class XMLEventFactory
extends Object

このインタフェースは、XMLEvent のインスタンスを作成するためのユーティリティークラスを定義します。

導入されたバージョン:
1.6
関連項目:
StartElement, EndElement, ProcessingInstruction, Comment, Characters, StartDocument, EndDocument, DTD

コンストラクタの概要
protected XMLEventFactory()
           
 
メソッドの概要
abstract  Attribute createAttribute(QName name, String value)
          新しい Attribute を作成します。
abstract  Attribute createAttribute(String localName, String value)
          新しい Attribute を作成します。
abstract  Attribute createAttribute(String prefix, String namespaceURI, String localName, String value)
          新しい Attribute を作成します。
abstract  Characters createCData(String content)
          CData フラグが true に設定されている Characters イベントを作成します。
abstract  Characters createCharacters(String content)
          Characters イベントを作成します。
abstract  Comment createComment(String text)
          コメントを作成します。
abstract  DTD createDTD(String dtd)
          文書型定義イベントを作成します。
abstract  EndDocument createEndDocument()
          EndDocument イベントの新しいインスタンスを作成します。
abstract  EndElement createEndElement(QName name, Iterator namespaces)
          新しい EndElement を作成します。
abstract  EndElement createEndElement(String prefix, String namespaceUri, String localName)
          新しい EndElement を作成します。
abstract  EndElement createEndElement(String prefix, String namespaceUri, String localName, Iterator namespaces)
          新しい EndElement を作成します。
abstract  EntityReference createEntityReference(String name, EntityDeclaration declaration)
          EntityReference イベントの新しいインスタンスを作成します。
abstract  Characters createIgnorableSpace(String content)
          無視できる空白を作成します。
abstract  Namespace createNamespace(String namespaceURI)
          新しいデフォルトの Namespace を作成します。
abstract  Namespace createNamespace(String prefix, String namespaceUri)
          新しい Namespace を作成します。
abstract  ProcessingInstruction createProcessingInstruction(String target, String data)
          処理命令を作成します。
abstract  Characters createSpace(String content)
          isSpace フラグが true に設定されている Characters イベントを作成します。
abstract  StartDocument createStartDocument()
          StartDocument イベントの新しいインスタンスを作成します。
abstract  StartDocument createStartDocument(String encoding)
          StartDocument イベントの新しいインスタンスを作成します。
abstract  StartDocument createStartDocument(String encoding, String version)
          StartDocument イベントの新しいインスタンスを作成します。
abstract  StartDocument createStartDocument(String encoding, String version, boolean standalone)
          StartDocument イベントの新しいインスタンスを作成します。
abstract  StartElement createStartElement(QName name, Iterator attributes, Iterator namespaces)
          新しい StartElement を作成します。
abstract  StartElement createStartElement(String prefix, String namespaceUri, String localName)
          新しい StartElement を作成します。
abstract  StartElement createStartElement(String prefix, String namespaceUri, String localName, Iterator attributes, Iterator namespaces)
          新しい StartElement を作成します。
abstract  StartElement createStartElement(String prefix, String namespaceUri, String localName, Iterator attributes, Iterator namespaces, NamespaceContext context)
          新しい StartElement を作成します。
static XMLEventFactory newInstance()
          ファクトリの新しいインスタンスを作成します。
static XMLEventFactory newInstance(String factoryId, ClassLoader classLoader)
          ファクトリの新しいインスタンスを作成します。
abstract  void setLocation(Location location)
          このメソッドを使用すると、このファクトリによって作成された各イベントで Location を設定できます。
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

XMLEventFactory

protected XMLEventFactory()
メソッドの詳細

newInstance

public static XMLEventFactory newInstance()
                                   throws FactoryConfigurationError
ファクトリの新しいインスタンスを作成します。

例外:
FactoryConfigurationError - このファクトリのインスタンスがロードできない場合

newInstance

public static XMLEventFactory newInstance(String factoryId,
                                          ClassLoader classLoader)
                                   throws FactoryConfigurationError
ファクトリの新しいインスタンスを作成します。

パラメータ:
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

public abstract Attribute createAttribute(String localName,
                                          String value)
新しい Attribute を作成します。

パラメータ:
localName - 属性の XML 名のローカル名。localName を null にすることはできない
value - 設定される属性値。null 以外
戻り値:
指定した値を持つ Attribute

createAttribute

public abstract Attribute createAttribute(QName name,
                                          String value)
新しい Attribute を作成します。

パラメータ:
name - 属性の修飾名。null 以外
value - 設定される属性値。null 以外
戻り値:
指定した値を持つ Attribute

createNamespace

public abstract Namespace createNamespace(String namespaceURI)
新しいデフォルトの Namespace を作成します。

パラメータ:
namespaceURI - デフォルトの名前空間 URI
戻り値:
指定された値を持つ Namespace

createNamespace

public abstract Namespace createNamespace(String prefix,
                                          String namespaceUri)
新しい Namespace を作成します。

パラメータ:
prefix - この名前空間の接頭辞。null 以外
namespaceUri - 属性値はこの値に設定される。null 以外
戻り値:
指定された値を持つ Namespace

createStartElement

public abstract StartElement createStartElement(QName name,
                                                Iterator attributes,
                                                Iterator 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 に設定します。このイベントを名前空間または属性で照会すると、空の反復子が返されます。

パラメータ:
namespaceUri - 新しい StartElement の QName の URI
localName - 新しい StartElement の QName のローカル名
prefix - 新しい StartElement の QName の接頭辞
戻り値:
要求された StartElement のインスタンス

createStartElement

public abstract StartElement createStartElement(String prefix,
                                                String namespaceUri,
                                                String localName,
                                                Iterator attributes,
                                                Iterator 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 のインスタンス

createStartElement

public abstract StartElement createStartElement(String prefix,
                                                String namespaceUri,
                                                String localName,
                                                Iterator attributes,
                                                Iterator 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 のインスタンス

createEndElement

public abstract EndElement createEndElement(QName name,
                                            Iterator namespaces)
新しい EndElement を作成します。

パラメータ:
name - EndElement の修飾名
namespaces - 範囲外になった Namespace を実装するオブジェクトの 順序付けされていないオプションセット。null の場合もある
戻り値:
要求された EndElement のインスタンス

createEndElement

public abstract EndElement createEndElement(String prefix,
                                            String namespaceUri,
                                            String localName)
新しい EndElement を作成します。

パラメータ:
namespaceUri - 新しい StartElement の QName の URI
localName - 新しい StartElement の QName のローカル名
prefix - 新しい StartElement の QName の接頭辞
戻り値:
要求された EndElement のインスタンス

createEndElement

public abstract EndElement createEndElement(String prefix,
                                            String namespaceUri,
                                            String localName,
                                            Iterator namespaces)
新しい EndElement を作成します。

パラメータ:
namespaceUri - 新しい StartElement の QName の URI
localName - 新しい StartElement の QName のローカル名
prefix - 新しい 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

public abstract Comment createComment(String text)
コメントを作成します。

パラメータ:
text - コメントのテキスト
戻り値:
Comment イベント

createProcessingInstruction

public abstract ProcessingInstruction createProcessingInstruction(String target,
                                                                  String data)
処理命令を作成します。

パラメータ:
target - 処理命令のターゲット
data - 処理命令のテキスト
戻り値:
ProcessingInstruction イベント

createDTD

public abstract DTD createDTD(String dtd)
文書型定義イベントを作成します。この文字列には、XML 1.0 仕様の doctypedecl に一致する文書型宣言のすべてが含まれます。

パラメータ:
dtd - 文書型定義のテキスト
戻り値:
DTD イベント

JavaTM Platform
Standard Ed. 6

バグの報告と機能のリクエスト
さらに詳しい API リファレンスおよび開発者ドキュメントについては、Java SE 開発者用ドキュメントを参照してください。開発者向けの詳細な解説、概念の概要、用語の定義、バグの回避策、およびコード実例が含まれています。

Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。