A hack/workaround for Dart reflectClass performance issue.