Skip to content

Expose more AbstractBeanDefinition methods in BeanDefinition [SPR-17275] #21808

Closed
@spring-projects-issues

Description

@spring-projects-issues

Sébastien Deleuze opened SPR-17275 and commented

When using functional bean registration, BeanDefinitionCustomizer lambda gives access to a BeanDefinition lambda parameter that does not give access to various AbstractBeanDefinition methods, requiring a cast to AbstractBeanDefinition which is not elegant and make our API not very discoverable for those use cases.

I think it could be useful to expose those methods in BeanDefinition interface:  

  • setAbstract
  • setAutowireMode
  • getAutowireMode
  • setDependencyCheck
  • getDependencyCheck
  • setInitMethodName
  • getInitMethodName
  • getDestroyMethodName
  • setDestroyMethodName
  • setRole
  • getRole
  • setDescription
  • getDescription

Those ones are candidates as well, but I have no real use case in mind for them for the moment, so they are not mandatory to expose:

  • addQualifier
  • getQualifiers
  • hasQualifier
  • getQualifier
  • setLenientConstructorResolution
  • isLenientConstructorResolution
  • setResourceDescription
  • getResourceDescription

Issue Links:

Referenced from: commits f783967, c4aea62, 97cea7f

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