abstract class AbstractBeanDefinitionParser : BeanDefinitionParser
Abstract BeanDefinitionParser implementation providing a number of convenience methods and a Use this BeanDefinitionParser implementation when you want to parse some arbitrarily complex XML into one or more BeanDefinition. If you just want to parse some XML into a single |
|
abstract class AbstractSimpleBeanDefinitionParser : AbstractSingleBeanDefinitionParser
Convenient base class for when there exists a one-to-one mapping between attribute names on the element that is to be parsed and the property names on the Class being configured. Extend this parser class when you want to create a single bean definition from a relatively simple custom XML element. The resulting An example will hopefully make the use of this particular parser class immediately clear. Consider the following class definition:
Then let us assume the following XML tag has been defined to permit the easy configuration of instances of the above class;
All that is required of the Java developer tasked with writing the parser to parse the above XML tag into an actual
Please note that the The process of actually registering the For an example of this parser in action (so to speak), do look at the source code for the org.springframework.beans.factory.xml.UtilNamespaceHandler.PropertiesBeanDefinitionParser; the observant (and even not so observant) reader will immediately notice that there is next to no code in the implementation. The
The observant reader will notice that the sole attribute on the |
|
abstract class AbstractSingleBeanDefinitionParser : AbstractBeanDefinitionParser
Base class for those BeanDefinitionParser implementations that need to parse and define just a single Extend this parser class when you want to create a single bean definition from an arbitrarily complex XML element. You may wish to consider extending the AbstractSimpleBeanDefinitionParser when you want to create a single bean definition from a relatively simple custom XML element. The resulting |
|
interface BeanDefinitionDocumentReader
SPI for parsing an XML document that contains Spring bean definitions. Used by XmlBeanDefinitionReader for actually parsing a DOM document. Instantiated per document to parse: implementations can hold state in instance variables during the execution of the |
|
open class BeansDtdResolver : EntityResolver
EntityResolver implementation for the Spring beans DTD, to load the DTD from the Spring class path (or JAR file). Fetches "spring-beans.dtd" from the class path resource "/org/springframework/beans/factory/xml/spring-beans.dtd", no matter whether specified as some local URL that includes "spring-beans" in the DTD name or as "http://www.springframework.org/dtd/spring-beans-2.0.dtd". |
|
open class DefaultBeanDefinitionDocumentReader : BeanDefinitionDocumentReader
Default implementation of the BeanDefinitionDocumentReader interface that reads bean definitions according to the "spring-beans" DTD and XSD format (Spring's default XML bean definition format). The structure, elements, and attribute names of the required XML document are hard-coded in this class. (Of course a transform could be run if necessary to produce this format). |
|
open class DefaultDocumentLoader : DocumentLoader
Spring's default DocumentLoader implementation. Simply loads Document using the standard JAXP-configured XML parser. If you want to change the DocumentBuilder that is used to load documents, then one strategy is to define a corresponding Java system property when starting your JVM. For example, to use the Oracle DocumentBuilder, you might start your application like as follows:
|
|
open class DefaultNamespaceHandlerResolver : 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 |
|
open class DocumentDefaultsDefinition : DefaultsDefinition
Simple JavaBean that holds the defaults specified at the |
|
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: The pattern for the mapping files can be overidden using the |
|
open class ResourceEntityResolver : DelegatingEntityResolver
EntityResolver implementation that tries to resolve entity references through a org.springframework.core.io.ResourceLoader (usually, relative to the resource base of an ApplicationContext), if applicable. Extends DelegatingEntityResolver to also provide DTD and XSD lookup. Allows to use standard XML entities to include XML snippets into an application context definition, for example to split a large XML file into various modules. The include paths can be relative to the application context's resource base as usual, instead of relative to the JVM working directory (the XML parser's default). Note: In addition to relative paths, every URL that specifies a file in the current system root, i.e. the JVM working directory, will be interpreted relative to the application context too. |
|
open class SimpleConstructorNamespaceHandler : NamespaceHandler
Simple An example of the usage of this Here the 'c:name ' corresponds directly to the 'name ' argument declared on the constructor of class 'TestBean '. The 'c:work-ref ' attributes corresponds to the 'work ' argument and, rather than being the concrete value, it contains the name of the bean that will be considered as a parameter. Note: This implementation supports only named parameters - there is no support for indexes or types. Further more, the names are used as hints by the container which, by default, does type introspection.
|
|
open class SimplePropertyNamespaceHandler : NamespaceHandler
Simple An example of the usage of this Here the 'p:name ' corresponds directly to the 'name ' property on class 'TestBean '. The 'p:spouse-ref ' attributes corresponds to the 'spouse ' property and, rather than being the concrete value, it contains the name of the bean that will be injected into that property.
|
|
open class UtilNamespaceHandler : NamespaceHandlerSupport
NamespaceHandler for the |
|
open class XmlBeanFactory : DefaultListableBeanFactory
Convenience extension of DefaultListableBeanFactory that reads bean definitions from an XML document. Delegates to XmlBeanDefinitionReader underneath; effectively equivalent to using an XmlBeanDefinitionReader with a DefaultListableBeanFactory. The structure, element and attribute names of the required XML document are hard-coded in this class. (Of course a transform could be run if necessary to produce this format). "beans" doesn't need to be the root element of the XML document: This class will parse all bean definition elements in the XML file. This class registers each bean definition with the DefaultListableBeanFactory superclass, and relies on the latter's implementation of the BeanFactory interface. It supports singletons, prototypes, and references to either of these kinds of bean. See For advanced needs, consider using a DefaultListableBeanFactory with an XmlBeanDefinitionReader. The latter allows for reading from multiple XML resources and is highly configurable in its actual XML parsing behavior. |
|
open class XmlReaderContext : ReaderContext
Extension of org.springframework.beans.factory.parsing.ReaderContext, specific to use with an XmlBeanDefinitionReader. Provides access to the NamespaceHandlerResolver configured in the XmlBeanDefinitionReader. |
open class XmlBeanDefinitionStoreException : BeanDefinitionStoreException
XML-specific BeanDefinitionStoreException subclass that wraps a org.xml.sax.SAXException, typically a org.xml.sax.SAXParseException which contains information about the error location. |