|
||||||||||
| 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
net.sf.doolin.context.spring.AbstractDefinitionParser
net.sf.doolin.context.spring.SimpleDefinitionParser<C>
C - Type of bean which is created by this parser.public class SimpleDefinitionParser<C>
Customisable parser for custom elements. It can be used both as parser or as a decorator.
| Field Summary |
|---|
| Fields inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser |
|---|
ID_ATTRIBUTE |
| Constructor Summary | |
|---|---|
SimpleDefinitionParser(Class<C> beanClass)
Constructor |
|
| Method Summary | ||
|---|---|---|
SimpleDefinitionParser<C> |
addAttributeRef(String attributeName)
Uses the value of an attribute as a reference to a bean. |
|
SimpleDefinitionParser<C> |
addAttributeRef(String attributeName,
String propertyName)
Uses the value of an attribute as a reference to a bean. |
|
SimpleDefinitionParser<C> |
addCustomBeanAs(String customBeanName,
String propertyName)
Registers a child element which must be parsed as a custom element. |
|
SimpleDefinitionParser<C> |
addFactoryFromAttribute(String attributeName,
String propertyName,
SimpleBeanFactory beanFactory)
Specifies that the value of an attribute must be used to create an object that will be used as a property value. |
|
SimpleDefinitionParser<C> |
addPropertyValue(String propertyName,
String propertyValue)
Specifies the value for a property |
|
SimpleDefinitionParser<C> |
addSimpleAttribute(String attributeName)
Specifies that the value of the given attribute must be used as the value for the property that has the same name |
|
SimpleDefinitionParser<C> |
addSimpleAttribute(String attributeName,
String propertyName)
Specifies that the value of the given attribute must be used as the value of a property. |
|
org.springframework.beans.factory.config.BeanDefinitionHolder |
decorate(Node node,
org.springframework.beans.factory.config.BeanDefinitionHolder holder,
org.springframework.beans.factory.xml.ParserContext parserContext)
|
|
void |
doParse(Element element,
org.springframework.beans.factory.xml.ParserContext parserContext,
org.springframework.beans.factory.support.BeanDefinitionBuilder builder)
Changes scope to public. |
|
protected Class<C> |
getBeanClass(Element element)
|
|
static
|
getInstance(Class<T> beanClass)
Creates an instance of a parser for the given bean class |
|
SimpleDefinitionParser<C> |
setContainerProperty(String property)
Specifies that the parsed bean must be used as a property in the containing bean. |
|
SimpleDefinitionParser<C> |
setDefaultID(String defaultID)
Sets the default ID to use when none is provided |
|
SimpleDefinitionParser<C> |
setList(String childName,
String propertyName)
The child element defined by childName defines a list of
objects which will be put in the propertyName property of
the parsed bean. |
|
SimpleDefinitionParser<C> |
setListString(String childName,
String propertyName)
The child element defined by childName defines a list of
Strings which will be put in the propertyName
property of the parsed bean. |
|
SimpleDefinitionParser<C> |
setMap(String childName,
String propertyName)
The child element defined by childName is a map (containing
<entry>s elements) that will be stored in the
propertyName property of the parsed bean. |
|
| Methods inherited from class net.sf.doolin.context.spring.AbstractDefinitionParser |
|---|
delegate, setAttributeAsProperty, setAttributeAsProperty, setAttributeAsReference, setChildrenAsListProperty, setElementAsProperty, setElementAsProperty, setListAsProperty, setListStringAsProperty, setMapAsProperty, setPropertyValue |
| 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 SimpleDefinitionParser(Class<C> beanClass)
beanClass - Class of the object to create| Method Detail |
|---|
public static <T> SimpleDefinitionParser<T> getInstance(Class<T> beanClass)
T - Type of parser to createbeanClass - Class of the bean to create
public SimpleDefinitionParser<C> addAttributeRef(String attributeName)
attributeName - Attribute name
public SimpleDefinitionParser<C> addAttributeRef(String attributeName,
String propertyName)
attributeName - Attribute namepropertyName - Property name
public SimpleDefinitionParser<C> addCustomBeanAs(String customBeanName,
String propertyName)
customBeanName - Name of the custom element.propertyName - Property that must hold the parsed custom element.
public SimpleDefinitionParser<C> addFactoryFromAttribute(String attributeName,
String propertyName,
SimpleBeanFactory beanFactory)
attributeName - Attribute namepropertyName - Property namebeanFactory - Factory that creates an object from the value of the attribute
public SimpleDefinitionParser<C> addPropertyValue(String propertyName,
String propertyValue)
propertyName - Property namepropertyValue - Property value
public SimpleDefinitionParser<C> addSimpleAttribute(String attributeName)
attributeName - Attribute name
public SimpleDefinitionParser<C> addSimpleAttribute(String attributeName,
String propertyName)
attributeName - Attribute namepropertyName - Property name
public org.springframework.beans.factory.config.BeanDefinitionHolder decorate(Node node,
org.springframework.beans.factory.config.BeanDefinitionHolder holder,
org.springframework.beans.factory.xml.ParserContext parserContext)
decorate in interface org.springframework.beans.factory.xml.BeanDefinitionDecorator
public void doParse(Element element,
org.springframework.beans.factory.xml.ParserContext parserContext,
org.springframework.beans.factory.support.BeanDefinitionBuilder builder)
AbstractDefinitionParser
doParse in class AbstractDefinitionParserprotected Class<C> getBeanClass(Element element)
getBeanClass in class org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParserpublic SimpleDefinitionParser<C> setContainerProperty(String property)
property - Name of property that must contain the parsed bean in the
containing bean
public SimpleDefinitionParser<C> setDefaultID(String defaultID)
defaultID - Default ID
public SimpleDefinitionParser<C> setList(String childName,
String propertyName)
childName defines a list of
objects which will be put in the propertyName property of
the parsed bean.
childName - Name of the children that define the listpropertyName - Property that must hold the list
public SimpleDefinitionParser<C> setListString(String childName,
String propertyName)
childName defines a list of
Strings which will be put in the propertyName
property of the parsed bean.
childName - Name of the children that define the list of StringspropertyName - Property that must hold the list
public SimpleDefinitionParser<C> setMap(String childName,
String propertyName)
childName is a map (containing
<entry>s elements) that will be stored in the
propertyName property of the parsed bean.
childName - Name of the child that contains the mappropertyName - Property that must hold the map
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||