I'm trying to inject a java.util.prefs.Preferences bean in to my master controller. The controller looks like:
@Controller
class MyController {
@Autowired
private Preferences preferences;
}
The application-context.xml file creates the bean for java.util.prefs.Preferences. It uses a factory method so I have the following entry for creating the bean:
<bean id="preferences" class="java.util.prefs.Preferences" factory-method="userNodeForPackage" />
Preferences.userNodeForPackage(param) takes for a parameter the class related to the Preference. In this case Spring needs to create the bean by performing the call:
Preferences.userNodeForPackage(MyController.class);
How can a class be passed in to a spring bean instantiated with a factory method? Thanks
Environment information:
Java 7
Spring 3.1