Skip to content

Overriding DocumentDefaultsDefinitions retrieval from root element attributes [SPR-6010] #10678

Closed
@spring-projects-issues

Description

@spring-projects-issues

Tuomas Kiviaho opened SPR-6010 and commented

Currently DocumentDefaultsDefinition initialization seeks always the given root element attributes for default values. Overriding of the behavior requires creation and initialization of the DocumentDefaultsDefinition which is lazily created at BeanDefinitionParserDelegate.initDefaults(Element) method. Manual creation is impossible without reflection because the field where the default are held is private.

I propose that this field is made protected and/or construction of the default implementation is made along field the field declaration to help out overriding of the initDefaults method.

protected DocumentDefaultsDefinition defaults = new DocumentDefaultsDefinition();

More radical change would be altering the behaviour is binding the initialization to happen only when delegate.isDefaultNamespace(Element root) is true but this might have impact on custom implementations already out there so I guess this is completely out of the question.


Affects: 2.5.6

Referenced from: commits a805819

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions