spring-framework / org.springframework.beans.factory.xml / PluggableSchemaResolver

PluggableSchemaResolver

open class PluggableSchemaResolver : EntityResolver

EntityResolver implementation that attempts to resolve schema URLs into local ClassPathResource 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

Author
Rob Harrop

Author
Juergen Hoeller

Since
2.0

Constructors

<init>

PluggableSchemaResolver(classLoader: ClassLoader)

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

PluggableSchemaResolver(classLoader: ClassLoader, schemaMappingsLocation: String)

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

Properties

DEFAULT_SCHEMA_MAPPINGS_LOCATION

static val DEFAULT_SCHEMA_MAPPINGS_LOCATION: String

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

Functions

resolveEntity

open fun resolveEntity(publicId: String, systemId: String): InputSource

toString

open fun toString(): String