クラス DefaultDocumentLoader
java.lang.ObjectSE
org.springframework.beans.factory.xml.DefaultDocumentLoader
- 実装されたすべてのインターフェース:
DocumentLoader
Spring のデフォルトの
DocumentLoader
実装。 標準の JAXP 構成の XML パーサーを使用して documents
SE をロードするだけです。ドキュメントのロードに使用される DocumentBuilder
SE を変更する場合、1 つの戦略は、JVM の起動時に対応する Java システムプロパティを定義することです。例: Oracle DocumentBuilder
SE を使用するには、次のようにアプリケーションを起動します。
java -Djavax.xml.parsers.DocumentBuilderFactory=oracle.xml.jaxp.JXDocumentBuilderFactory MyMainClass
- 導入:
- 2.0
- 作成者:
- Rob Harrop, Juergen Hoeller
コンストラクターの概要
コンストラクターメソッドのサマリー
修飾子と型メソッド説明protected DocumentBuilderSE
createDocumentBuilder
(DocumentBuilderFactorySE factory, EntityResolverSE entityResolver, ErrorHandlerSE errorHandler) この Bean 定義リーダーが XML ドキュメントの解析に使用する JAXP DocumentBuilder を作成します。protected DocumentBuilderFactorySE
createDocumentBuilderFactory
(int validationMode, boolean namespaceAware) DocumentBuilderFactory
SE インスタンスを作成します。loadDocument
(InputSourceSE inputSource, EntityResolverSE entityResolver, ErrorHandlerSE errorHandler, int validationMode, boolean namespaceAware) 標準の JAXP 構成の XML パーサーを使用して、提供されたInputSource
SE でDocument
SE をロードします。
コンストラクターの詳細
DefaultDocumentLoader
public DefaultDocumentLoader()
メソッドの詳細
loadDocument
public DocumentSE loadDocument(InputSourceSE inputSource, EntityResolverSE entityResolver, ErrorHandlerSE errorHandler, int validationMode, boolean namespaceAware) throws ExceptionSE 標準の JAXP 構成の XML パーサーを使用して、提供されたInputSource
SE でDocument
SE をロードします。- 次で指定:
- インターフェース
DocumentLoader
のloadDocument
- パラメーター:
inputSource
- ロードされるドキュメントのソースentityResolver
- エンティティを解決するために使用されるリゾルバーerrorHandler
- ドキュメントのロード中にエラーを報告するために使用されますvalidationMode
- 検証の型DTD
またはXSD
)namespaceAware
- XML 名前空間のサポートを提供する場合はtrue
- 戻り値:
- ロードされた
document
SE - 例外:
ExceptionSE
- エラーが発生した場合
createDocumentBuilderFactory
protected DocumentBuilderFactorySE createDocumentBuilderFactory(int validationMode, boolean namespaceAware) throws ParserConfigurationExceptionSE DocumentBuilderFactory
SE インスタンスを作成します。- パラメーター:
validationMode
- 検証の型:DTD
またはXSD
)namespaceAware
- 返されたファクトリが XML 名前空間のサポートを提供するかどうか- 戻り値:
- JAXP DocumentBuilderFactory
- 例外:
ParserConfigurationExceptionSE
- 適切な DocumentBuilderFactory の構築に失敗した場合
createDocumentBuilder
protected DocumentBuilderSE createDocumentBuilder(DocumentBuilderFactorySE factory, @Nullable EntityResolverSE entityResolver, @Nullable ErrorHandlerSE errorHandler) throws ParserConfigurationExceptionSE この Bean 定義リーダーが XML ドキュメントの解析に使用する JAXP DocumentBuilder を作成します。サブクラスでオーバーライドでき、ビルダーの初期化を追加します。- パラメーター:
factory
- DocumentBuilder を作成する必要がある JAXP DocumentBuilderFactoryentityResolver
- 使用する SAX EntityResolvererrorHandler
- 使用する SAX ErrorHandler- 戻り値:
- JAXP DocumentBuilder
- 例外:
ParserConfigurationExceptionSE
- JAXP メソッドによってスローされた場合