I want to instantiate one instance of a class from the string name of the class. ( using Class.forName().newInstance(). )
Here's the problem: I want that instance to be a singleton.. I could do this using a singleton pattern, except that newInstance calls the default constructor for a class, and with a singleton, that constructor must be "private"..
Is there a solution? I could think of a less elegant way to do this (using a hashmap as a lookup table..), but would prefer a better solution..
Thanks,