|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser
public class DefaultXmlBeanDefinitionParser
Default implementation of the XmlBeanDefinitionParser interface. Parses bean definitions according to the "spring-beans" DTD, i.e. 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). "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.
Constructor Summary | |
---|---|
DefaultXmlBeanDefinitionParser()
|
Method Summary | |
---|---|
protected int |
getAutowireMode(String att)
|
protected BeanDefinitionReader |
getBeanDefinitionReader()
|
protected String |
getDefaultAutowire()
|
protected String |
getDefaultDependencyCheck()
|
protected String |
getDefaultLazyInit()
|
protected int |
getDependencyCheck(String att)
|
protected Resource |
getResource()
|
protected void |
importBeanDefinitionResource(Element ele)
Parse an "import" element and load the bean definitions from the given resource into the bean factory. |
protected BeanDefinitionHolder |
parseBeanDefinitionElement(Element ele)
Parse a standard bean definition into a BeanDefinitionHolder, including bean name and aliases. |
protected BeanDefinition |
parseBeanDefinitionElement(Element ele,
String beanName)
Parse the BeanDefinition itself, without regard to name or aliases. |
protected int |
parseBeanDefinitions(Element root)
Parse the elements at the root level in the document: "import", "alias", "bean". |
protected void |
parseConstructorArgElement(Element ele,
String beanName,
ConstructorArgumentValues cargs)
Parse a constructor-arg element. |
protected ConstructorArgumentValues |
parseConstructorArgElements(Element beanEle,
String beanName)
Parse constructor-arg sub-elements of the given bean element. |
protected Object |
parseKeyElement(Element keyEle,
String beanName)
Parse a key sub-element of a map element. |
protected List |
parseListElement(Element collectionEle,
String beanName)
Parse a list element. |
protected void |
parseLookupOverrideSubElements(Element beanEle,
String beanName,
MethodOverrides overrides)
Parse lookup-override sub-elements of the given bean element. |
protected Map |
parseMapElement(Element mapEle,
String beanName)
Parse a map element. |
protected void |
parsePropertyElement(Element ele,
String beanName,
MutablePropertyValues pvs)
Parse a property element. |
protected MutablePropertyValues |
parsePropertyElements(Element beanEle,
String beanName)
Parse property sub-elements of the given bean element. |
protected Object |
parsePropertySubElement(Element ele,
String beanName)
Parse a value, ref or collection sub-element of a property or constructor-arg element. |
protected Object |
parsePropertyValue(Element ele,
String beanName,
String propertyName)
Get the value of a property element. |
protected Properties |
parsePropsElement(Element propsEle,
String beanName)
Parse a props element. |
protected void |
parseReplacedMethodSubElements(Element beanEle,
String beanName,
MethodOverrides overrides)
Parse replaced-method sub-elements of the given bean element. |
protected Set |
parseSetElement(Element collectionEle,
String beanName)
Parse a set element. |
int |
registerBeanDefinitions(BeanDefinitionReader reader,
Document doc,
Resource resource)
Parse bean definitions from the given DOM document, and register them with the given bean factory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String BEAN_NAME_DELIMITERS
public static final String TRUE_VALUE
public static final String DEFAULT_VALUE
public static final String DESCRIPTION_ELEMENT
public static final String AUTOWIRE_BY_NAME_VALUE
public static final String AUTOWIRE_BY_TYPE_VALUE
public static final String AUTOWIRE_CONSTRUCTOR_VALUE
public static final String AUTOWIRE_AUTODETECT_VALUE
public static final String DEPENDENCY_CHECK_ALL_ATTRIBUTE_VALUE
public static final String DEPENDENCY_CHECK_SIMPLE_ATTRIBUTE_VALUE
public static final String DEPENDENCY_CHECK_OBJECTS_ATTRIBUTE_VALUE
public static final String DEFAULT_LAZY_INIT_ATTRIBUTE
public static final String DEFAULT_DEPENDENCY_CHECK_ATTRIBUTE
public static final String DEFAULT_AUTOWIRE_ATTRIBUTE
public static final String IMPORT_ELEMENT
public static final String RESOURCE_ATTRIBUTE
public static final String ALIAS_ELEMENT
public static final String NAME_ATTRIBUTE
public static final String ALIAS_ATTRIBUTE
public static final String BEAN_ELEMENT
public static final String ID_ATTRIBUTE
public static final String PARENT_ATTRIBUTE
public static final String CLASS_ATTRIBUTE
public static final String ABSTRACT_ATTRIBUTE
public static final String SINGLETON_ATTRIBUTE
public static final String LAZY_INIT_ATTRIBUTE
public static final String AUTOWIRE_ATTRIBUTE
public static final String DEPENDENCY_CHECK_ATTRIBUTE
public static final String DEPENDS_ON_ATTRIBUTE
public static final String INIT_METHOD_ATTRIBUTE
public static final String DESTROY_METHOD_ATTRIBUTE
public static final String FACTORY_METHOD_ATTRIBUTE
public static final String FACTORY_BEAN_ATTRIBUTE
public static final String CONSTRUCTOR_ARG_ELEMENT
public static final String INDEX_ATTRIBUTE
public static final String TYPE_ATTRIBUTE
public static final String PROPERTY_ELEMENT
public static final String REF_ATTRIBUTE
public static final String VALUE_ATTRIBUTE
public static final String LOOKUP_METHOD_ELEMENT
public static final String REPLACED_METHOD_ELEMENT
public static final String REPLACER_ATTRIBUTE
public static final String ARG_TYPE_ELEMENT
public static final String ARG_TYPE_MATCH_ATTRIBUTE
public static final String REF_ELEMENT
public static final String IDREF_ELEMENT
public static final String BEAN_REF_ATTRIBUTE
public static final String LOCAL_REF_ATTRIBUTE
public static final String PARENT_REF_ATTRIBUTE
public static final String VALUE_ELEMENT
public static final String NULL_ELEMENT
public static final String LIST_ELEMENT
public static final String SET_ELEMENT
public static final String MAP_ELEMENT
public static final String ENTRY_ELEMENT
public static final String KEY_ELEMENT
public static final String KEY_ATTRIBUTE
public static final String KEY_REF_ATTRIBUTE
public static final String VALUE_REF_ATTRIBUTE
public static final String PROPS_ELEMENT
public static final String PROP_ELEMENT
protected final Log logger
Constructor Detail |
---|
public DefaultXmlBeanDefinitionParser()
Method Detail |
---|
public int registerBeanDefinitions(BeanDefinitionReader reader, Document doc, Resource resource) throws BeanDefinitionStoreException
XmlBeanDefinitionParser
registerBeanDefinitions
in interface XmlBeanDefinitionParser
reader
- the bean definition reader, containing the bean factory
to work on and the bean class loader to use. Can also be used to load
further bean definition files referenced by the given document.doc
- the DOM documentresource
- descriptor of the original XML resource
(useful for displaying parse errors)
BeanDefinitionStoreException
- in case of parsing errorsprotected final BeanDefinitionReader getBeanDefinitionReader()
protected final Resource getResource()
protected final String getDefaultLazyInit()
protected final String getDefaultDependencyCheck()
protected final String getDefaultAutowire()
protected int parseBeanDefinitions(Element root) throws BeanDefinitionStoreException
root
- the DOM root element of the document
BeanDefinitionStoreException
protected void importBeanDefinitionResource(Element ele) throws BeanDefinitionStoreException
BeanDefinitionStoreException
protected BeanDefinitionHolder parseBeanDefinitionElement(Element ele) throws BeanDefinitionStoreException
Bean elements specify their canonical name as "id" attribute and their aliases as a delimited "name" attribute.
If no "id" specified, uses the first name in the "name" attribute as canonical name, registering all others as aliases.
BeanDefinitionStoreException
protected BeanDefinition parseBeanDefinitionElement(Element ele, String beanName) throws BeanDefinitionStoreException
BeanDefinitionStoreException
protected int getDependencyCheck(String att)
protected int getAutowireMode(String att)
protected ConstructorArgumentValues parseConstructorArgElements(Element beanEle, String beanName) throws BeanDefinitionStoreException
BeanDefinitionStoreException
protected MutablePropertyValues parsePropertyElements(Element beanEle, String beanName) throws BeanDefinitionStoreException
BeanDefinitionStoreException
protected void parseLookupOverrideSubElements(Element beanEle, String beanName, MethodOverrides overrides) throws BeanDefinitionStoreException
BeanDefinitionStoreException
protected void parseReplacedMethodSubElements(Element beanEle, String beanName, MethodOverrides overrides) throws BeanDefinitionStoreException
BeanDefinitionStoreException
protected void parseConstructorArgElement(Element ele, String beanName, ConstructorArgumentValues cargs) throws BeanDefinitionStoreException
BeanDefinitionStoreException
protected void parsePropertyElement(Element ele, String beanName, MutablePropertyValues pvs) throws BeanDefinitionStoreException
BeanDefinitionStoreException
protected Object parsePropertyValue(Element ele, String beanName, String propertyName) throws BeanDefinitionStoreException
BeanDefinitionStoreException
protected Object parsePropertySubElement(Element ele, String beanName) throws BeanDefinitionStoreException
ele
- subelement of property element; we don't know which yet
BeanDefinitionStoreException
protected List parseListElement(Element collectionEle, String beanName) throws BeanDefinitionStoreException
BeanDefinitionStoreException
protected Set parseSetElement(Element collectionEle, String beanName) throws BeanDefinitionStoreException
BeanDefinitionStoreException
protected Map parseMapElement(Element mapEle, String beanName) throws BeanDefinitionStoreException
BeanDefinitionStoreException
protected Object parseKeyElement(Element keyEle, String beanName) throws BeanDefinitionStoreException
BeanDefinitionStoreException
protected Properties parsePropsElement(Element propsEle, String beanName) throws BeanDefinitionStoreException
BeanDefinitionStoreException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |