Example #1
0
 public JavaClass loadClass(String className) throws ClassNotFoundException {
   ClassInfo cls = AppInfo.getSingleton().loadClass(className);
   if (cls != null) {
     return cls.getJavaClass(false);
   }
   return null;
 }
Example #2
0
 public JavaClass findClass(String className) {
   ClassInfo cls = AppInfo.getSingleton().getClassInfo(className);
   if (cls != null) {
     return cls.getJavaClass(false);
   }
   return null;
 }
Example #3
0
 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;
 }
Example #4
0
 public int getMyField(ClassInfo clsInfo) {
   Object value = clsInfo.getCustomValue(myFieldID);
   // just for demo, do some null-pointer handling
   return value != null ? (Integer) value : -1;
 }
Example #5
0
 public int setMyField(ClassInfo clsInfo, int value) {
   return (Integer) clsInfo.setCustomValue(myFieldID, value);
 }
Example #6
0
 @Override
 public void onCreateClass(ClassInfo classInfo, boolean loaded) {
   // set our custom attribute to every new class
   classInfo.setCustomValue(myFieldID, classInfo.getAppInfo().getClassInfos().size());
 }