I am having trouble getting the declared fields of an Object that is missing/not using specific dependencies.
Field[] fields = OBJECT.getClass().getDeclaredFields();
throws a NoClassDefFoundError
when that object has imports to missing classes.
The reason I want to do this is for a Bukkit plugin. I want to get the fields of a plugin instance that has missing dependencies (they are not used, but the plugin can start).
At runtime that plugin will check if the required dependencies are present and depending on that it will load those specific fields.
Possible solutions I thought of:
1) Virtually create the missing classes + packages and try again using ASM. But I don't really know how to do this.
Regards,
Maxim