7 C++用のツールAPIパッケージ
Toolsパッケージには、Oracle XMLツールを作成およびインスタンス化するための型とメソッドが含まれます。Toolsのデータ型、FactoryメソッドおよびFactoryExceptionメソッドが含まれます。
Factoryインタフェース
表7-2にFactoryインタフェースで使用できるメソッドの概要を示します。
表7-2 Factoryメソッドの概要: ツール・パッケージ
| 関数 | 概要 |
|---|---|
|
コンストラクタです。 |
|
|
DOMパーサーを作成します。 |
|
|
SAXパーサーを作成します。 |
|
|
スキーマ・バリデータを作成します。 |
|
|
拡張XPathプロセッサを作成します。 |
|
|
XPathコンパイラを作成します。 |
|
|
XPathプロセッサを作成します。 |
|
|
XPointerプロセッサを作成します。 |
|
|
Xslコンパイラを作成します。 |
|
|
XSL拡張トランスフォーマを作成します。 |
|
|
XSLトランスフォーマを作成します。 |
|
|
ファクトリのコンテキストを取得します。 |
|
|
デフォルトのデストラクタです。 |
Factory()
クラス・コンストラクタです。
| 構文 | 説明 |
|---|---|
Factory() throw (FactoryException); |
デフォルトのコンストラクタです |
Factory( Context* ctx_ptr) throw (FactoryException); |
コンテキスト・オブジェクトを指定してファクトリ・オブジェクトを作成します。 |
| パラメータ | 説明 |
|---|---|
ctx_ptr |
コンテキスト・オブジェクトへのポインタ |
戻り値
(Factory)オブジェクト
createDOMParser()
DOMパーサーを作成します。
構文
DOMParser< Context, Node>* createDOMParser ( DOMParserIdType id_type, Context* ctx_ptr = NULL) throw (FactoryException);
| パラメータ | 説明 |
|---|---|
id_type |
パーサーIDの型 |
ctx_ptr |
コンテキスト・オブジェクトへのポインタ |
戻り値
(DOMParser*) パーサー・オブジェクトへのポインタ。
createSAXParser()
SAXパーサーを作成します。
構文
SAXParser< Context>* createSAXParser ( SAXParserIdType id_type, Context* ctx_ptr = NULL) throw (FactoryException);
| パラメータ | 説明 |
|---|---|
id_type |
パーサーIDの型 |
ctx_ptr |
コンテキスト・オブジェクトへのポインタ |
戻り値
(SAXParser*) パーサー・オブジェクトへのポインタ。
createSchemaValidator()
スキーマ・バリデータを作成します。
構文
SchemaValidator< Node>* createSchemaValidator ( SchValidatorIdType id_type, Context* ctx_ptr = NULL) throw (FactoryException);
| パラメータ | 説明 |
|---|---|
id_type |
バリデータIDの型 |
ctx_ptr |
コンテキスト・オブジェクトへのポインタ |
戻り値
(SchemaValidator*) バリデータ・オブジェクトへのポインタ。
createXPathCompProcessor()
拡張XPathプロセッサを作成します。値XvmPrCXmlのみをとります。
構文
CompProcessor< Context, Node>* createXPathCompProcessor ( XPathPrIdType id_type, Context* ctx_ptr = NULL) throw (FactoryException);
| パラメータ | 説明 |
|---|---|
id_type |
プロセッサIDの型 |
ctx_ptr |
コンテキスト・オブジェクトへのポインタ |
戻り値
(CompProcessor*) プロセッサ・オブジェクトへのポインタ。
createXPathCompiler()
XPathコンパイラを作成します。
構文
XPath::Compiler< Context, Node>* createXPathCompiler ( XPathCompIdType id_type, Context* ctx_ptr = NULL) throw (FactoryException);
| パラメータ | 説明 |
|---|---|
id_type |
コンパイラIDの型 |
ctx_ptr |
コンテキスト・オブジェクトへのポインタ |
戻り値
(XpathCompiler*) コンパイラ・オブジェクトへのポインタ。
createXPathProcessor()
XPathプロセッサを作成します。
構文
XPath::Processor< Context, Node>* createXPathProcessor ( XPathPrIdType id_type, Context* ctx_ptr = NULL) throw (FactoryException);
| パラメータ | 説明 |
|---|---|
id_type |
プロセッサIDの型 |
ctx_ptr |
コンテキスト・オブジェクトへのポインタ |
戻り値
(Processor*) プロセッサ・オブジェクトへのポインタ。
createXPointerProcessor()
XPointerプロセッサを作成します。
構文
XPointer::Processor< Context, Node>* createXPointerProcessor ( XppPrIdType id_type, Context* ctx_ptr = NULL) throw (FactoryException);
| パラメータ | 説明 |
|---|---|
id_type |
プロセッサIDの型 |
ctx_ptr |
コンテキスト・オブジェクトへのポインタ |
戻り値
(Processor*) プロセッサ・オブジェクトへのポインタ。
createXslCompiler()
Xslコンパイラを作成します。
構文
Xsl::Compiler< Context, Node>* createXslCompiler ( XslCompIdType id_type, Context* ctx_ptr = NULL) throw (FactoryException);
| パラメータ | 説明 |
|---|---|
id_type |
コンパイラIDの型 |
ctx_ptr |
コンテキスト・オブジェクトへのポインタ |
戻り値
(Compiler*) コンパイラ・オブジェクトへのポインタ。
createXslExtendedTransformer()
XSL拡張transformerを作成します。値XvmTrCXmlのみをとります。
構文
CompTransformer< Context, Node>* createXslExtendedTransformer ( XslTrIdType id_type, Context* ctx_ptr = NULL) throw (FactoryException);
| パラメータ | 説明 |
|---|---|
id_type |
トランスフォーマIDの型 |
ctx_ptr |
コンテキスト・オブジェクトへのポインタ |
戻り値
(CompTrasformer*) トランスフォーマ・オブジェクトへのポインタ。
createXslTransformer()
XSLトランスフォーマを作成します。
構文
Transformer< Context, Node>* createXslTransformer ( XslTrIdType id_type, Context* ctx_ptr = NULL) throw (FactoryException);
| パラメータ | 説明 |
|---|---|
id_type |
トランスフォーマIDの型 |
ctx_ptr |
コンテキスト・オブジェクトへのポインタ |
戻り値
(Trasformer*) トランスフォーマ・オブジェクトへのポインタ。
FactoryExceptionインタフェース
表7-3にFactoryExceptionインタフェースで使用できるメソッドの概要を示します。
表7-3 FactoryExceptionメソッドの概要: ツール・パッケージ
| 関数 | 概要 |
|---|---|
|
例外に埋め込まれたOracle XMLエラー・コードを取得します。 |
|
|
例外に埋め込まれたFactoryExceptionコードを取得します。 |
|
|
エラー・メッセージの現在の言語(エンコーディング)を取得します。 |
|
|
Oracle XMLエラー・メッセージを取得します。 |
getCode()
例外に埋め込まれたOracle XMLエラー・コードを取得します。XmlExceptionから継承された仮想メンバー関数です。
構文
virtual unsigned getCode() const = 0;
戻り値
(unsigned) 数値のエラー・コード(正常に終了した場合は0)。
getFactoryCode()
これは実行時の例外状況の、FactoryExceptionCodeで定義されたツール名前空間に固有の例外コードを戻す、実装で定義済のメンバー関数のプロトタイプを定義する仮想メンバー関数です。
構文
virtual FactoryExceptionCode getFactoryCode() const = 0;
戻り値
(FactoryExceptionCode)例外コード
getMesLang()
XmlExceptionから継承された仮想メンバー関数です。
構文
virtual oratext* getMesLang() const = 0;
戻り値
(oratext*) エラー・メッセージの現在の言語(エンコーディング)。