public JavaClass loadClass(String className) throws ClassNotFoundException { ClassInfo cls = AppInfo.getSingleton().loadClass(className); if (cls != null) { return cls.getJavaClass(false); } return null; }
public JavaClass findClass(String className) { ClassInfo cls = AppInfo.getSingleton().getClassInfo(className); if (cls != null) { return cls.getJavaClass(false); } return null; }
public JavaClass loadClass(Class clazz) throws ClassNotFoundException { ClassInfo cls; try { cls = AppInfo.getSingleton().loadClass(clazz.getName(), false, false); } catch (ClassInfoNotFoundException e) { throw new ClassNotFoundException(e.getMessage(), e); } if (cls != null) { return cls.getJavaClass(false); } return null; }
public int getMyField(ClassInfo clsInfo) { Object value = clsInfo.getCustomValue(myFieldID); // just for demo, do some null-pointer handling return value != null ? (Integer) value : -1; }
public int setMyField(ClassInfo clsInfo, int value) { return (Integer) clsInfo.setCustomValue(myFieldID, value); }
@Override public void onCreateClass(ClassInfo classInfo, boolean loaded) { // set our custom attribute to every new class classInfo.setCustomValue(myFieldID, classInfo.getAppInfo().getClassInfos().size()); }