How can I use reflection to create a generic parameterized class in Java?
I have
public class SomeClass<T> {
public SomeClass<T>() {
}
}
and I need an instance of it.
I've tried variations of
Class c = Class.forName("SomeClass");
but could not find a syntax that would allow me to get an appropriately typed instance, like, say
SomeType instance = (SomeType)Class.forName("SomeClass<SomeType>").createInstance();
So, how could I go about doing this?