Skip to content

Doc: Update ComponentBeanDefinitionParser example to work with nested child Components [SPR-3709] #8390

@spring-projects-issues

Description

@spring-projects-issues

Brett Randall opened SPR-3709 and commented

The example of custom XML extensions described in Spring Reference Appendix B - "B.7. Meatier examples" could be improved.

The XML schema for foo:component allows for nesting of components to an arbitrary depth, i.e. component with child components that themselves cotain child components, and so on.

The sample ComponentBeanDefinitionParser in the documentation cannot deal with more than a single level of nested components, and so cannot effectively create all beans describable by the schema. Unit tests to retrieve a grandchild component of the top-level component fail.

The sample can be improved by making child component bean-processing recursive, allowing for nesting to any depth. This is achieved by composing child Component-s using their own ComponentFactoryBean.

Code to follow.


Affects: 2.0.6

Attachments:

Referenced from: commits 1bbe93e

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions