public class ResourceEntityResolver extends DelegatingEntityResolver
ResourceLoader
を介してエンティティ参照を解決しようとする EntityResolver
実装(通常、ApplicationContext
のリソースベースに対して)。DelegatingEntityResolver
を拡張して、DTD および XSD ルックアップも提供します。標準の XML エンティティを使用して、XML スニペットをアプリケーションコンテキスト定義に含めることができます。たとえば、大きな XML ファイルをさまざまなモジュールに分割できます。インクルードパスは、JVM 作業ディレクトリ(XML パーサーのデフォルト)を基準にするのではなく、通常どおりアプリケーションコンテキストのリソースベースを基準にすることができます。
メモ: 相対パスに加えて、現在のシステムルート、つまり、JVM 作業ディレクトリ内のファイルを指定するすべての URL は、アプリケーションコンテキストを基準にして解釈されます。
ResourceLoader
, ApplicationContext
DTD_SUFFIX, XSD_SUFFIX
コンストラクターと説明 |
---|
ResourceEntityResolver(ResourceLoader resourceLoader) 指定された ResourceLoader の ResourceEntityResolver(通常は ApplicationContext)を作成します。 |
修飾子と型 | メソッドと説明 |
---|---|
InputSourceSE | resolveEntity(StringSE publicId, StringSE systemId) |
toString
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, waitSE, waitSE, waitSE
public ResourceEntityResolver(ResourceLoader resourceLoader)
resourceLoader
- XML エンティティを読み込む ResourceLoader(または ApplicationContext)インクルード @Nullable public InputSourceSE resolveEntity(@Nullable StringSE publicId, @Nullable StringSE systemId) throws SAXExceptionSE, IOExceptionSE
EntityResolverSE
の resolveEntitySE
DelegatingEntityResolver
の resolveEntity
SAXExceptionSE
IOExceptionSE