I have a custom namespace I'm parsing for a Spring project, and I'm having trouble with RuntimeBeanReferences. I have a class MyClass that takes a List. In my beandef file, I have a bean defined of type MyObject named "MyObj".
In my custom namespace parser, I have code that looks like this:
RootBeanDefinition myBean = new RootBeanDefinition(MyClass.class);
ConstructorArgumentValues cav = new ConstructorArgumentValues();
List list = new LinkedList();
list.add(new RuntimeBeanReference("MyObj"));
cav.addIndexedArgumentValue(0, list);
However, when I lookup the bean through spring, I get an exception saying it can't convert RuntimeBeanReference to MyObject. Do I need to do something specific to force the reference to be resolved?
thanks,
Jeff
I just found it. I need to use a ManagedList instead of a regular LinkedList. The ManagedList (and ManagedMap) will have references resolved by Spring.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With