Using a static nested class like Spring bean

How to instantiate a static nested class like Spring bean in XML configuration file? For instance:

package com.x.y;
public class A {
    public static class B {
    ...
    }
}

So, do I have a Spring-installed class bean B?

+5
source share
1 answer

Using syntax A$B, which is a class loader that sees inner classes. So, assuming a package com.x.y, then:

<bean id="myBean" class="com.x.y.A$B"/>
+9
source

All Articles