The Spring Framework

org.springframework.beans.factory.xml
Class DelegatingEntityResolver

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

public class DelegatingEntityResolver
extends Object
implements EntityResolver

EntityResolver implementation that delegates to a BeansDtdResolver and a PluggableSchemaResolver for DTDs and XML schemas, respectively.

Since:
2.0
Author:
Rob Harrop, Juergen Hoeller, Rick Evans
See Also:
BeansDtdResolver, PluggableSchemaResolver

Field Summary
static String DTD_SUFFIX
          Suffix for DTD files
protected  Log logger
          Logger available to subclasses
static String XSD_SUFFIX
          Suffix for schema definition files
 
Constructor Summary
DelegatingEntityResolver(ClassLoader classLoader)
          Create a new DelegatingEntityResolver that delegates to a default BeansDtdResolver and a default PluggableSchemaResolver.
DelegatingEntityResolver(EntityResolver dtdResolver, EntityResolver schemaResolver)
          Create a new DelegatingEntityResolver that delegates to the given EntityResolvers.
 
Method Summary
 InputSource resolveEntity(String publicId, String systemId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DTD_SUFFIX

public static final String DTD_SUFFIX
Suffix for DTD files

See Also:
Constant Field Values

XSD_SUFFIX

public static final String XSD_SUFFIX
Suffix for schema definition files

See Also:
Constant Field Values

logger

protected final Log logger
Logger available to subclasses

Constructor Detail

DelegatingEntityResolver

public DelegatingEntityResolver(ClassLoader classLoader)
Create a new DelegatingEntityResolver that delegates to a default BeansDtdResolver and a default PluggableSchemaResolver.

Configures the PluggableSchemaResolver with the supplied ClassLoader.

Parameters:
classLoader - the ClassLoader to use for loading
Throws:
IllegalArgumentException - if the supplied class loader is null

DelegatingEntityResolver

public DelegatingEntityResolver(EntityResolver dtdResolver,
                                EntityResolver schemaResolver)
Create a new DelegatingEntityResolver that delegates to the given EntityResolvers.

Parameters:
dtdResolver - the EntityResolver to resolve DTDs with
schemaResolver - the EntityResolver to resolve XML schemas with
Throws:
IllegalArgumentException - if either of the supplied resolvers is null
Method Detail

resolveEntity

public InputSource resolveEntity(String publicId,
                                 String systemId)
                          throws SAXException,
                                 IOException
Specified by:
resolveEntity in interface EntityResolver
Throws:
SAXException
IOException

The Spring Framework

Copyright © 2002-2006 The Spring Framework.