public PluginMetadata generateMetadata(Class<? extends IPlugin> plugin) {
if (!plugin.isAnnotationPresent(Plugin.class)) {
throw new IllegalArgumentException(String.format("Plugin %s is not annotated!", plugin.getSimpleName()));
}
Plugin pl = plugin.getDeclaredAnnotation(Plugin.class);
return new PluginMetadata(pl.name(), pl.id(), pl.author(), pl.type());
}
public void internalPluginLoad(Class<? extends IPlugin> pluginClass) {
try {
PluginMetadata metadata = generateMetadata(pluginClass);