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="author" class="..TestBean" c:name="Enescu" c:work-ref="compositions"/>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 parameterNote
This implementation supports only named parameters - there is no support for indexes or types. Furthermore, the names are used as hints by the container which, by default, does type introspection.
SimplePropertyNamespaceHandler
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private boolean | |
| private boolean | |
| public BeanDefinitionHolder | decorate(Node
the source element or attribute that is to be parsed node, BeanDefinitionHolder the current bean definition definition, ParserContext the object encapsulating the current state of the parsing process parserContext)Implements org. Parse the specified |
| public void | init()
Implements org. Invoked by the |
| public BeanDefinition | parse(Element
the element that is to be parsed into one or more element, ParserContext BeanDefinitionsthe object encapsulating the current state of the parsing process parserContext)Implements org. Parse the specified |
| DELIMITER_PREFIX | back to summary |
|---|---|
| private static final String DELIMITER_PREFIX | |
| REF_SUFFIX | back to summary |
|---|---|
| private static final String REF_SUFFIX | |
| SimpleConstructorNamespaceHandler | back to summary |
|---|---|
| public SimpleConstructorNamespaceHandler() | |
| checkName | back to summary |
|---|---|
| private boolean checkName(String name, Collection<ConstructorArgumentValues. | |
| containsArgWithName | back to summary |
|---|---|
| private boolean containsArgWithName(String name, ConstructorArgumentValues cvs) | |
| decorate | back to summary |
|---|---|
| public BeanDefinitionHolder decorate(Node node, BeanDefinitionHolder definition, ParserContext parserContext) Implements org. Doc from org. Parse the specified The Implementations may choose to return a completely new definition,
which will replace the original definition in the resulting
The supplied
| |
| init | back to summary |
|---|---|
| public void init() Implements org. Doc from org. Invoked by the
| |
| parse | back to summary |
|---|---|
| public BeanDefinition parse(Element element, ParserContext parserContext) Implements org. Doc from org. Parse the specified Implementations should return the primary Implementations may return
| |