|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver
public class DefaultNamespaceHandlerResolver
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.
NamespaceHandler
,
DefaultBeanDefinitionDocumentReader
Field Summary | |
---|---|
private java.lang.ClassLoader |
classLoader
ClassLoader to use for NamespaceHandler classes |
static java.lang.String |
DEFAULT_HANDLER_MAPPINGS_LOCATION
The location to look for the mapping files. |
private java.util.Map<java.lang.String,java.lang.Object> |
handlerMappings
Stores the mappings from namespace URI to NamespaceHandler class name / instance |
private java.lang.String |
handlerMappingsLocation
Resource location to search for |
protected Log |
logger
Logger available to subclasses |
Constructor Summary | |
---|---|
DefaultNamespaceHandlerResolver()
Create a new DefaultNamespaceHandlerResolver using the
default mapping file location. |
|
DefaultNamespaceHandlerResolver(java.lang.ClassLoader classLoader)
Create a new DefaultNamespaceHandlerResolver using the
default mapping file location. |
|
DefaultNamespaceHandlerResolver(java.lang.ClassLoader classLoader,
java.lang.String handlerMappingsLocation)
Create a new DefaultNamespaceHandlerResolver using the
supplied mapping file location. |
Method Summary | |
---|---|
private java.util.Map<java.lang.String,java.lang.Object> |
getHandlerMappings()
Load the specified NamespaceHandler mappings lazily. |
NamespaceHandler |
resolve(java.lang.String namespaceUri)
Locate the NamespaceHandler for the supplied namespace URI
from the configured mappings. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_HANDLER_MAPPINGS_LOCATION
protected final Log logger
private final java.lang.ClassLoader classLoader
private final java.lang.String handlerMappingsLocation
private volatile java.util.Map<java.lang.String,java.lang.Object> handlerMappings
Constructor Detail |
---|
public DefaultNamespaceHandlerResolver()
DefaultNamespaceHandlerResolver
using the
default mapping file location.
This constructor will result in the thread context ClassLoader being used to load resources.
DEFAULT_HANDLER_MAPPINGS_LOCATION
public DefaultNamespaceHandlerResolver(java.lang.ClassLoader classLoader)
DefaultNamespaceHandlerResolver
using the
default mapping file location.
classLoader
- the ClassLoader
instance used to load mapping resources
(may be null
, in which case the thread context ClassLoader will be used)DEFAULT_HANDLER_MAPPINGS_LOCATION
public DefaultNamespaceHandlerResolver(java.lang.ClassLoader classLoader, java.lang.String handlerMappingsLocation)
DefaultNamespaceHandlerResolver
using the
supplied mapping file location.
classLoader
- the ClassLoader
instance used to load mapping resources
may be null
, in which case the thread context ClassLoader will be used)handlerMappingsLocation
- the mapping file locationMethod Detail |
---|
public NamespaceHandler resolve(java.lang.String namespaceUri)
NamespaceHandler
for the supplied namespace URI
from the configured mappings.
resolve
in interface NamespaceHandlerResolver
namespaceUri
- the relevant namespace URI
NamespaceHandler
, or null
if none foundprivate java.util.Map<java.lang.String,java.lang.Object> getHandlerMappings()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |