I have an enumeration like this:
public enum SomeEnum { ONE (new MyClass()), TWO (new MyClass()); private final MyClass instance; private SomeEnum(MyClass instance) { this.instance = instance; } }
How to pass an instance of MyClass to an enumeration constructor from a Spring context? Is it possible?
I need this because I pass some parameters from the config file (.properties) to the MyClass instance when I create it. Now I am doing this in an xml file with beans, maybe there is another way?
source share