Package com.godshawk.lib.plugin.metadata

Examples of com.godshawk.lib.plugin.metadata.PluginMetadata


    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());
    }
View Full Code Here


        return new PluginMetadata(pl.name(), pl.id(), pl.author(), pl.type());
    }

    public void internalPluginLoad(Class<? extends IPlugin> pluginClass) {
        try {
            PluginMetadata metadata = generateMetadata(pluginClass);
            IPlugin plugin = pluginClass.getDeclaredConstructor(
                    PluginManager.class, File.class, File.class
            ).newInstance(
                    this, pluginDir, new File(
                            String.format("%s%s%s.%s",
                                    pluginDir.getAbsolutePath(),
                                    File.separator,
                                    metadata.getKeyValue(EnumPluginKeys.PLUGIN_ID.getValue()),
                                    configExtension
                            )
                    )
            );
            plugin.setMetadata(metadata);
View Full Code Here

TOP

Related Classes of com.godshawk.lib.plugin.metadata.PluginMetadata

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.