java - How to remove a property from a spring bean -
I want to remove an asset from a spring bean, this property is an object or Java primitive-ish type (string, int , Map ..)
& lt; Bean id = "test" class = "meat. Xxxx" & gt; & Lt; Property Name = "User" ref = "Mete.Tech" /> & Lt; Property name = "other" ref = "meetst others" /> & Lt; / Bean & gt; I can create a new class to implement BeanFactoryPostProcessor
and override PostProcessBeanFactory
I do not want to remove this method, but I do not know how to remove an object property from Bean property.
Thank you.
It is not clear what you want to achieve, but if you want to remove, for example For,
& lt; Property name = "other" ref = "me.test.other" /> Before the bean started, declare beanfactor post processor
with the following implementation in its implementation @Override Public Zero Post Process throws the BENFactor (Configurable Liquid BinFeeter Beanfacture) Beans Expansion Is {Binidification Bean Definition = Bean Factor.GetBean Definition ("Test"); // Get the Bean Definition in some way if (Beidentification! = Null) {beanDefinition.getPropertyValues (). RemovePropertyValue ("Other"); // Removing property value based on some criteria}}
Comments
Post a Comment