Kagetaka

net.hizlab.kagetaka.parser
クラス ParserManager

java.lang.Object
  拡張net.hizlab.kagetaka.parser.ParserManager

public final class ParserManager
extends Object

影鷹データファイルを解析するためのパーサを管理するクラスです。

バージョン:
$Revision: 1.1.1.1 $

入れ子クラスの概要
static class ParserManager.ParserInfo
          パーサ情報を格納するクラスです。
 
メソッドの概要
static boolean addParser(String className)
          パーサのクラス名を指定して、そのパーサを登録します。
static ContentParser createInstance(String className, Content content, Reporter reporter)
          コンテンツパーサのインスタンスを作成します。
static FilterParser createInstance(String className, Content content, Reporter reporter, Parser parser)
          フィルタパーサのインスタンスを作成します。
static ParserManager.ParserInfo getParser(String name)
          名前に該当するパーサを返します。
static ParserManager.ParserInfo[] getParserList()
          登録済みのパーサ一覧を返します。
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

メソッドの詳細

addParser

public static boolean addParser(String className)
パーサのクラス名を指定して、そのパーサを登録します。 ここで追加するクラスは、コンテンツパーサ(ContentParser)か、 フィルタパーサ(FilterParser) を実装したクラスでなければいけません。

パラメータ:
className - パーサのクラス名
戻り値:
登録に成功した場合は true、 それ以外の場合は false

createInstance

public static ContentParser createInstance(String className,
                                           Content content,
                                           Reporter reporter)
                                    throws IOException
コンテンツパーサのインスタンスを作成します。

このメソッドでは、フィルタパーサのインスタンスは作成出来ません。 フィルタパーサのインスタンスを作成するには、 createInstance(String, Content, Reporter, Parser) を利用します。

パラメータ:
className - パーサのクラス名
content - コンテンツ
reporter - エラーレポータ
戻り値:
パーサのインスタンス、作成出来ない場合は null
例外:
IOException - IO エラーが発生した場合

createInstance

public static FilterParser createInstance(String className,
                                          Content content,
                                          Reporter reporter,
                                          Parser parser)
フィルタパーサのインスタンスを作成します。

このメソッドでは、コンテンツパーサのインスタンスは作成出来ません。 コンテンツパーサのインスタンスを作成するには、 createInstance(String, Content, Reporter) を利用します。

パラメータ:
className - パーサのクラス名
content - ドキュメント情報
reporter - エラーレポータ
parser - フィルタ対象のパーサ
戻り値:
パーサのインスタンス、作成出来ない場合は null

getParser

public static ParserManager.ParserInfo getParser(String name)
名前に該当するパーサを返します。

パラメータ:
name - パーサのクラス名
戻り値:
パーサ、存在しない場合は null

getParserList

public static ParserManager.ParserInfo[] getParserList()
登録済みのパーサ一覧を返します。

戻り値:
パーサ一覧

Kagetaka

Copyright (c) 2002-2004 The Kagetaka Project 'November 20, 2004'