开发者

how to read spring beans definitions

开发者 https://www.devze.com 2023-01-16 10:46 出处:网络
I need to read the bean definitions from a Spring context file, practically reading what is inside the XML. I do not want to instantiate beans, I just want to read the content of the file.

I need to read the bean definitions from a Spring context file, practically reading what is inside the XML. I do not want to instantiate beans, I just want to read the content of the file.

While I can write a parser to do so, I imagine Spring already does this. What classes does it use (I am running around the XmlBeanDefinitionReader related classes but I am not sure how to use them)?

How can I load the XML into bean definitions using Spring's c开发者_StackOverflow社区lasses?

I am using Spring 2.0.

Thank you!


If you create an XmlBeanFactory you can then use the methods in the ListableBeanFactory interface to inspect available beans, and get a BeanDefintion object as necessary using getBeanDefinition(beanName)

0

精彩评论

暂无评论...
验证码 换一张
取 消