public class

PluggableSchemaResolver

extends Object
implements EntityResolver
java.lang.Object
   ↳ org.springframework.beans.factory.xml.PluggableSchemaResolver

Class Overview

EntityResolver implementation that attempts to resolve schema URLs into local classpath resources using a set of mappings files.

By default, this class will look for mapping files in the classpath using the pattern: META-INF/spring.schemas allowing for multiple files to exist on the classpath at any one time. The format of META-INF/spring.schemas is a properties file where each line should be of the form systemId=schema-location where schema-location should also be a schema file in the classpath. Since systemId is commonly a URL, one must be careful to escape any ':' characters which are treated as delimiters in properties files.

The pattern for the mapping files can be overidden using the PluggableSchemaResolver(ClassLoader, String) constructor

Summary

Constants
String DEFAULT_SCHEMA_MAPPINGS_LOCATION The location of the file that defines schema mappings.
Public Constructors
PluggableSchemaResolver(ClassLoader classLoader)
Loads the schema URL -> schema file location mappings using the default mapping file pattern "META-INF/spring.schemas".
PluggableSchemaResolver(ClassLoader classLoader, String schemaMappingsLocation)
Loads the schema URL -> schema file location mappings using the given mapping file pattern.
Public Methods
InputSource resolveEntity(String publicId, String systemId)
String toString()
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.xml.sax.EntityResolver

Constants

public static final String DEFAULT_SCHEMA_MAPPINGS_LOCATION

Also: SpringBeans

The location of the file that defines schema mappings. Can be present in multiple JAR files.

Constant Value: "META-INF/spring.schemas"

Public Constructors

public PluggableSchemaResolver (ClassLoader classLoader)

Also: SpringBeans

Loads the schema URL -> schema file location mappings using the default mapping file pattern "META-INF/spring.schemas".

Parameters
classLoader the ClassLoader to use for loading (can be null) to use the default ClassLoader)

public PluggableSchemaResolver (ClassLoader classLoader, String schemaMappingsLocation)

Also: SpringBeans

Loads the schema URL -> schema file location mappings using the given mapping file pattern.

Parameters
classLoader the ClassLoader to use for loading (can be null) to use the default ClassLoader)
schemaMappingsLocation the location of the file that defines schema mappings (must not be empty)

Public Methods

public InputSource resolveEntity (String publicId, String systemId)

Also: SpringBeans

Throws
IOException

public String toString ()