Reputation: 29241
I would like to create a Spring Bean of a Inner class. If I have the following inner class B
:
package x.y.z;
public class A {
public class B { }
}
I would like to create bean instance in my XML configuration files.
<bean class="x.y.z.A.B" name="innerBean" />
Upvotes: 27
Views: 17588
Reputation: 29241
You cannot access your public static inner class with the dot (.
) notation, instead, use the currency ($
). An example:
<bean class="x.y.z.A$B" name="innerBean" />
This will work.
Upvotes: 41