diff options
Diffstat (limited to 'pf4j')
-rw-r--r-- | pf4j/src/main/java/ro/fortsoft/pf4j/ManifestPluginDescriptorFinder.java | 6 | ||||
-rw-r--r-- | pf4j/src/main/java/ro/fortsoft/pf4j/PropertiesPluginDescriptorFinder.java | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/pf4j/src/main/java/ro/fortsoft/pf4j/ManifestPluginDescriptorFinder.java b/pf4j/src/main/java/ro/fortsoft/pf4j/ManifestPluginDescriptorFinder.java index 0d23346..24ae751 100644 --- a/pf4j/src/main/java/ro/fortsoft/pf4j/ManifestPluginDescriptorFinder.java +++ b/pf4j/src/main/java/ro/fortsoft/pf4j/ManifestPluginDescriptorFinder.java @@ -85,7 +85,7 @@ public class ManifestPluginDescriptorFinder implements PluginDescriptorFinder { } protected PluginDescriptor createPluginDescriptor(Manifest manifest) { - PluginDescriptor pluginDescriptor = new PluginDescriptor(); + PluginDescriptor pluginDescriptor = createPluginDescriptorInstance(); // TODO validate !!! Attributes attributes = manifest.getMainAttributes(); @@ -120,6 +120,10 @@ public class ManifestPluginDescriptorFinder implements PluginDescriptorFinder { return pluginDescriptor; } + protected PluginDescriptor createPluginDescriptorInstance() { + return new PluginDescriptor(); + } + protected void validatePluginDescriptor(PluginDescriptor pluginDescriptor) throws PluginException { if (StringUtils.isEmpty(pluginDescriptor.getPluginId())) { throw new PluginException("Plugin-Id cannot be empty"); diff --git a/pf4j/src/main/java/ro/fortsoft/pf4j/PropertiesPluginDescriptorFinder.java b/pf4j/src/main/java/ro/fortsoft/pf4j/PropertiesPluginDescriptorFinder.java index 76c3750..544d76e 100644 --- a/pf4j/src/main/java/ro/fortsoft/pf4j/PropertiesPluginDescriptorFinder.java +++ b/pf4j/src/main/java/ro/fortsoft/pf4j/PropertiesPluginDescriptorFinder.java @@ -89,7 +89,7 @@ public class PropertiesPluginDescriptorFinder implements PluginDescriptorFinder } protected PluginDescriptor createPluginDescriptor(Properties properties) { - PluginDescriptor pluginDescriptor = new PluginDescriptor(); + PluginDescriptor pluginDescriptor = createPluginDescriptorInstance(); // TODO validate !!! String id = properties.getProperty("plugin.id"); @@ -112,6 +112,10 @@ public class PropertiesPluginDescriptorFinder implements PluginDescriptorFinder return pluginDescriptor; } + protected PluginDescriptor createPluginDescriptorInstance() { + return new PluginDescriptor(); + } + protected void validatePluginDescriptor(PluginDescriptor pluginDescriptor) throws PluginException { if (StringUtils.isEmpty(pluginDescriptor.getPluginId())) { throw new PluginException("plugin.id cannot be empty"); |