1 package net.mograsim.logic.model.serializing;
3 public class ReflectionHelper
5 private ReflectionHelper()
9 public static Class<?> tryInvokeStaticInitializer(String className, String errorMessageFormat)
11 return tryInvokeStaticInitializer(className, errorMessageFormat, ReflectionHelper.class.getClassLoader());
14 public static Class<?> tryInvokeStaticInitializer(String className, String errorMessageFormat, ClassLoader classLoader)
18 return tryInvokeStaticInitializer(className, classLoader);
20 catch (ClassNotFoundException e)
22 System.err.printf(errorMessageFormat, className, "ClassNotFoundException thrown: " + e.getMessage());
27 public static Class<?> tryInvokeStaticInitializer(String className) throws ClassNotFoundException
29 return tryInvokeStaticInitializer(className, ReflectionHelper.class.getClassLoader());
32 public static Class<?> tryInvokeStaticInitializer(String className, ClassLoader classLoader) throws ClassNotFoundException
34 return Class.forName(className, true, classLoader);