Spring Framework

org.springframework.beans.factory.xml
Class ResourceEntityResolver

java.lang.Object
  extended by org.springframework.beans.factory.xml.DelegatingEntityResolver
      extended by org.springframework.beans.factory.xml.ResourceEntityResolver
All Implemented Interfaces:
org.xml.sax.EntityResolver

public class ResourceEntityResolver
extends DelegatingEntityResolver

EntityResolver implementation that tries to resolve entity references through a ResourceLoader (usually, relative to the resource base of an ApplicationContext), if applicable. Extends DelegatingEntityResolver to also provide DTD and XSD lookup.

Allows to use standard XML entities to include XML snippets into an application context definition, for example to split a large XML file into various modules. The include paths can be relative to the application context's resource base as usual, instead of relative to the JVM working directory (the XML parser's default).

Note: In addition to relative paths, every URL that specifies a file in the current system root, i.e. the JVM working directory, will be interpreted relative to the application context too.

Since:
31.07.2003
Author:
Juergen Hoeller
See Also:
ResourceLoader, ApplicationContext

Field Summary
 
Fields inherited from class org.springframework.beans.factory.xml.DelegatingEntityResolver
DTD_SUFFIX, XSD_SUFFIX
 
Constructor Summary
ResourceEntityResolver(ResourceLoader resourceLoader)
          Create a ResourceEntityResolver for the specified ResourceLoader (usually, an ApplicationContext).
 
Method Summary
 org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId)
           
 
Methods inherited from class org.springframework.beans.factory.xml.DelegatingEntityResolver
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResourceEntityResolver

public ResourceEntityResolver(ResourceLoader resourceLoader)
Create a ResourceEntityResolver for the specified ResourceLoader (usually, an ApplicationContext).

Parameters:
resourceLoader - the ResourceLoader (or ApplicationContext) to load XML entity includes with
Method Detail

resolveEntity

public org.xml.sax.InputSource resolveEntity(java.lang.String publicId,
                                             java.lang.String systemId)
                                      throws org.xml.sax.SAXException,
                                             java.io.IOException
Specified by:
resolveEntity in interface org.xml.sax.EntityResolver
Overrides:
resolveEntity in class DelegatingEntityResolver
Throws:
org.xml.sax.SAXException
java.io.IOException

Spring Framework