spring-framework / org.springframework.beans.factory.xml / SimplePropertyNamespaceHandler

SimplePropertyNamespaceHandler

open class SimplePropertyNamespaceHandler : NamespaceHandler

Simple NamespaceHandler implementation that maps custom attributes directly through to bean properties. An important point to note is that this NamespaceHandler does not have a corresponding schema since there is no way to know in advance all possible attribute names.

An example of the usage of this NamespaceHandler is shown below:

 <bean id="rob" class="..TestBean" p:name="Rob Harrop" p:spouse-ref="sally"/>
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.

Author
Rob Harrop

Author
Juergen Hoeller

Since
2.0

Constructors

<init>

SimplePropertyNamespaceHandler()

Simple NamespaceHandler implementation that maps custom attributes directly through to bean properties. An important point to note is that this NamespaceHandler does not have a corresponding schema since there is no way to know in advance all possible attribute names.

An example of the usage of this NamespaceHandler is shown below:

 <bean id="rob" class="..TestBean" p:name="Rob Harrop" p:spouse-ref="sally"/>
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.

Functions

decorate

open fun decorate(node: Node, definition: BeanDefinitionHolder, parserContext: ParserContext): BeanDefinitionHolder

init

open fun init(): Unit

parse

open fun parse(element: Element, parserContext: ParserContext): BeanDefinition