Class DefaultNamespaceHandlerResolver
java.lang.Object
org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver
- All Implemented Interfaces:
- NamespaceHandlerResolver
Default implementation of the 
NamespaceHandlerResolver interface.
Resolves namespace URIs to implementation classes based on the mappings
contained in mapping file.
By default, this implementation looks for the mapping file at
META-INF/spring.handlers, but this can be changed using the
DefaultNamespaceHandlerResolver(ClassLoader, String) constructor.
- Since:
- 2.0
- Author:
- Rob Harrop, Juergen Hoeller
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringThe location to look for the mapping files.protected final org.apache.commons.logging.LogLogger available to subclasses.
- 
Constructor SummaryConstructorsConstructorDescriptionCreate a newDefaultNamespaceHandlerResolverusing the default mapping file location.DefaultNamespaceHandlerResolver(@Nullable ClassLoader classLoader) Create a newDefaultNamespaceHandlerResolverusing the default mapping file location.DefaultNamespaceHandlerResolver(@Nullable ClassLoader classLoader, String handlerMappingsLocation) Create a newDefaultNamespaceHandlerResolverusing the supplied mapping file location.
- 
Method SummaryModifier and TypeMethodDescriptionLocate theNamespaceHandlerfor the supplied namespace URI from the configured mappings.toString()
- 
Field Details- 
DEFAULT_HANDLER_MAPPINGS_LOCATIONThe location to look for the mapping files. Can be present in multiple JAR files.- See Also:
 
- 
loggerprotected final org.apache.commons.logging.Log loggerLogger available to subclasses.
 
- 
- 
Constructor Details- 
DefaultNamespaceHandlerResolverpublic DefaultNamespaceHandlerResolver()Create a newDefaultNamespaceHandlerResolverusing the default mapping file location.This constructor will result in the thread context ClassLoader being used to load resources. - See Also:
 
- 
DefaultNamespaceHandlerResolverCreate a newDefaultNamespaceHandlerResolverusing the default mapping file location.- Parameters:
- classLoader- the- ClassLoaderinstance used to load mapping resources (may be- null, in which case the thread context ClassLoader will be used)
- See Also:
 
- 
DefaultNamespaceHandlerResolverpublic DefaultNamespaceHandlerResolver(@Nullable ClassLoader classLoader, String handlerMappingsLocation) Create a newDefaultNamespaceHandlerResolverusing the supplied mapping file location.- Parameters:
- classLoader- the- ClassLoaderinstance used to load mapping resources may be- null, in which case the thread context ClassLoader will be used
- handlerMappingsLocation- the mapping file location
 
 
- 
- 
Method Details- 
resolveLocate theNamespaceHandlerfor the supplied namespace URI from the configured mappings.- Specified by:
- resolvein interface- NamespaceHandlerResolver
- Parameters:
- namespaceUri- the relevant namespace URI
- Returns:
- the located NamespaceHandler, ornullif none found
 
- 
toString
 
-