|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.beans.factory.xml.AbstractBeanDefinitionParser
org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
org.apache.camel.spring.handler.BeanDefinitionParser
public class BeanDefinitionParser
A base class for a parser for a bean.
Field Summary |
---|
Fields inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser |
---|
ID_ATTRIBUTE |
Constructor Summary | |
---|---|
BeanDefinitionParser(Class type)
|
Method Summary | |
---|---|
protected void |
doParse(Element element,
BeanDefinitionBuilder builder)
Parse the supplied Element and populate the supplied
BeanDefinitionBuilder as required. |
protected String |
extractPropertyName(String attributeName)
Extract a JavaBean property name from the supplied attribute name. |
protected Class |
getBeanClass(Element element)
|
protected boolean |
isEligibleAttribute(String attributeName)
|
protected void |
postProcess(BeanDefinitionBuilder beanDefinition,
Element element)
Hook method that derived classes can implement to inspect/change a bean definition after parsing is complete. |
Methods inherited from class org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser |
---|
doParse, getBeanClassName, getParentName, parseInternal |
Methods inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser |
---|
parse, postProcessComponentDefinition, registerBeanDefinition, resolveId, shouldFireEvents, shouldGenerateId, shouldGenerateIdAsFallback |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BeanDefinitionParser(Class type)
Method Detail |
---|
protected Class getBeanClass(Element element)
getBeanClass
in class AbstractSingleBeanDefinitionParser
protected boolean isEligibleAttribute(String attributeName)
protected final void doParse(Element element, BeanDefinitionBuilder builder)
Element
and populate the supplied
BeanDefinitionBuilder
as required.
This implementation maps any attributes present on the
supplied element to PropertyValue
instances, and
adds them
to the
builder
.
The extractPropertyName(String)
method is used to
reconcile the name of an attribute with the name of a JavaBean
property.
doParse
in class AbstractSingleBeanDefinitionParser
element
- the XML element being parsedbuilder
- used to define the BeanDefinition
extractPropertyName(String)
protected String extractPropertyName(String attributeName)
The default implementation uses the
Conventions.attributeNameToPropertyName(String)
method to perform the extraction.
The name returned must obey the standard JavaBean property name
conventions. For example for a class with a setter method
'setBingoHallFavourite(String)
', the name returned had
better be 'bingoHallFavourite
' (with that exact casing).
attributeName
- the attribute name taken straight from the
XML element being parsed (never null
)
null
)protected void postProcess(BeanDefinitionBuilder beanDefinition, Element element)
The default implementation does nothing.
beanDefinition
- the parsed (and probably totally defined) bean definition being builtelement
- the XML element that was the source of the bean definition's metadata
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |