diff options
author | Decebal Suiu <decebal.suiu@gmail.com> | 2016-08-10 08:56:11 +0300 |
---|---|---|
committer | Decebal Suiu <decebal.suiu@gmail.com> | 2016-08-10 08:56:11 +0300 |
commit | d6f9ccb1196d12c96400889369a01122ed684160 (patch) | |
tree | b7ce5357b85135942c4508b91c5074a05eb55121 /pf4j | |
parent | dc08b1768b60073bfc7ae72d24f4e8e773187a11 (diff) | |
download | pf4j-d6f9ccb1196d12c96400889369a01122ed684160.tar.gz pf4j-d6f9ccb1196d12c96400889369a01122ed684160.zip |
#107
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"); |