@Test public void testLoadingOfJar() throws Exception { final File jarFile = new File("src/test/resources/com/igormaznitsa/mindmap/plugins/external/TestPlugin.jar"); assertTrue(jarFile.isFile()); final PluginClassLoader loader = new PluginClassLoader(jarFile); assertEquals("Igor Maznitsa", loader.getAttributes(Attribute.AUTHOR)); assertEquals("*", loader.getAttributes(Attribute.COMPATIBLE)); assertEquals("1.0.1-SNAPSHOT", loader.getAttributes(Attribute.VERSION)); assertEquals("It is just a test of class loader", loader.getAttributes(Attribute.REFERENCE)); assertEquals("1.2.0", loader.getAttributes(Attribute.API)); assertEquals("Some Test Plugin", loader.getAttributes(Attribute.TITLE)); assertEquals("com.igormaznitsa.testmmdplugin.TestPlugin", loader.getAttributes(Attribute.PLUGINS)); }
@Nullable public String getAttributes(@Nonnull final Attribute attr) { return this.attributes.get(attr.getAttrName()); }
PluginClassLoader extends URLClassLoader { @Nullable public String getAttributes(@Nonnull final Attribute attr) { return this.attributes.get(attr.getAttrName()); } }
PluginClassLoader extends URLClassLoader { @Nullable public String getAttributes(@Nonnull final Attribute attr) { return this.attributes.get(attr.getAttrName()); } PluginClassLoader(@Nonnull final File pluginFile); }
PluginClassLoader extends URLClassLoader { @Nullable public String getAttributes(@Nonnull final Attribute attr) { return this.attributes.get(attr.getAttrName()); } PluginClassLoader(@Nonnull final File pluginFile); @Nonnull @MustNotContainNull String[] extractPluginClassNames(); @Nullable Version extractVersion(); boolean isCompatibleWithIde(@Nonnull final Version ideVersion); @Nonnull Version getApiVersion(); @Nullable String getAttributes(@Nonnull final Attribute attr); @Nonnull File getFile(); }
PluginClassLoader extends URLClassLoader { @Nullable public String getAttributes(@Nonnull final Attribute attr) { return this.attributes.get(attr.getAttrName()); } PluginClassLoader(@Nonnull final File pluginFile); @Nonnull @MustNotContainNull String[] extractPluginClassNames(); @Nullable Version extractVersion(); boolean isCompatibleWithIde(@Nonnull final Version ideVersion); @Nonnull Version getApiVersion(); @Nullable String getAttributes(@Nonnull final Attribute attr); @Nonnull File getFile();  }