You need to sign in to do that
Don't have an account?
CCCBBBAAA
First-class classes?
I do not see that Apex exposes a class data type. Is this correct? Is there no way to assign a class to a variable in Apex? My research thus far indicates that Apex does not support any sort of metaprogramming, not even string evaluation. It seems most issues surrounding this question are centered on standard/custom object reflection, but I am seeking a way to pass classes around such that `Class myClass = SomeApexClass` can be instantiated with `new myClass(args...)`.
You can certainly do that, although I'm not sure you can specify arguments to the constructor this way. The class probably must have a public no-arg constructor for this to work.
See here: http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_type.htm