Hi Tomer,
I'll give you an idea, so you can further develop it.
Implement a custom BeanExpressionResolver. You may look at StandardBeanExpressionResolver in order to get an idea about how to do it.
With this custom implementation you should be free to do whatever you want when to parse @Value annotations.
Now, create a custom post processor, implementing BeanFactoryPostProcessor, and do the next:
Code:
public class YourCustomPostProcessor implements BeanFactoryPostProcessor{
private BeanExpressionResolver beanExpressionResolver; // and add setter/getter
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
beanFactory.setBeanExpressionResolver(this.beanExpressionResolver);
}
}
// Then in your xml file
<bean class="YourCustomPostProcessor">
<property name="beanExpressionResolver">
<bean class="YourCustomExpressionResolver" />
</property>
</bean>
I left many details out of the loop, but I think you can get idea and continue by your own from here.
Best,
Carlos.