Package org.springframework.beans.factory.xml

# Class DelegatingEntityResolver

java.lang.Object
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

Fields
Modifier and Type
Field
Description
`static final String`
`DTD_SUFFIX`
Suffix for DTD files.
`static final String`
`XSD_SUFFIX`
Suffix for schema definition files.

## Constructor Summary

Constructors
Constructor
Description
`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

Modifier and Type
Method
Description
`InputSource`
`resolveEntity(String publicId, String systemId)`
`String`
`toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### 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

## Constructor Details

### DelegatingEntityResolver

public DelegatingEntityResolver(@Nullable 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 (can be `null` to use the default ClassLoader)

### 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

## Method Details

### resolveEntity

@Nullable public InputSource resolveEntity(@Nullable String publicId, @Nullable String systemId) throws SAXException, IOException

Specified by:
  `resolveEntity` in interface `EntityResolver`
Throws:
  `SAXException`
  `IOException`

### toString

public String toString()

Overrides:
  `toString` in class `Object`