クラス DefaultDocumentLoader

java.lang.ObjectSE
org.springframework.beans.factory.xml.DefaultDocumentLoader
実装されたすべてのインターフェース:
DocumentLoader

public class DefaultDocumentLoader extends ObjectSE implements DocumentLoader
Spring のデフォルトの DocumentLoader 実装。

標準の JAXP 構成の XML パーサーを使用して documentsSE をロードするだけです。ドキュメントのロードに使用される DocumentBuilderSE を変更する場合、1 つの戦略は、JVM の起動時に対応する Java システムプロパティを定義することです。例: Oracle DocumentBuilderSE を使用するには、次のようにアプリケーションを起動します。

java -Djavax.xml.parsers.DocumentBuilderFactory=oracle.xml.jaxp.JXDocumentBuilderFactory MyMainClass
導入:
2.0
作成者:
Rob Harrop, Juergen Hoeller
  • コンストラクターの詳細

    • DefaultDocumentLoader

      public DefaultDocumentLoader()
  • メソッドの詳細

    • loadDocument

      public DocumentSE loadDocument(InputSourceSE inputSource, EntityResolverSE entityResolver, ErrorHandlerSE errorHandler, int validationMode, boolean namespaceAware) throws ExceptionSE
      標準の JAXP 構成の XML パーサーを使用して、提供された InputSourceSEDocumentSE をロードします。
      次で指定:
      インターフェース DocumentLoaderloadDocument 
      パラメーター:
      inputSource - ロードされるドキュメントのソース
      entityResolver - エンティティを解決するために使用されるリゾルバー
      errorHandler - ドキュメントのロード中にエラーを報告するために使用されます
      validationMode - 検証の型 DTD または XSD
      namespaceAware - XML 名前空間のサポートを提供する場合は true 
      戻り値:
      ロードされた documentSE
      例外:
      ExceptionSE - エラーが発生した場合
    • createDocumentBuilderFactory

      protected DocumentBuilderFactorySE createDocumentBuilderFactory(int validationMode, boolean namespaceAware) throws ParserConfigurationExceptionSE
      DocumentBuilderFactorySE インスタンスを作成します。
      パラメーター:
      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 DocumentBuilderFactory
      entityResolver - 使用する SAX EntityResolver
      errorHandler - 使用する SAX ErrorHandler
      戻り値:
      JAXP DocumentBuilder
      例外:
      ParserConfigurationExceptionSE - JAXP メソッドによってスローされた場合