aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pf4j/src/main/java/org/pf4j/DefaultPluginDescriptor.java21
1 files changed, 13 insertions, 8 deletions
diff --git a/pf4j/src/main/java/org/pf4j/DefaultPluginDescriptor.java b/pf4j/src/main/java/org/pf4j/DefaultPluginDescriptor.java
index bd6b297..e8ff380 100644
--- a/pf4j/src/main/java/org/pf4j/DefaultPluginDescriptor.java
+++ b/pf4j/src/main/java/org/pf4j/DefaultPluginDescriptor.java
@@ -146,7 +146,6 @@ public class DefaultPluginDescriptor implements PluginDescriptor {
return this;
}
-
protected DefaultPluginDescriptor setPluginVersion(String version) {
this.version = version;
@@ -171,13 +170,18 @@ public class DefaultPluginDescriptor implements PluginDescriptor {
if (dependencies != null) {
dependencies = dependencies.trim();
if (!dependencies.isEmpty()) {
- String[] tokens = dependencies.split(",");
- for (String dependency : tokens) {
- dependency = dependency.trim();
- if (!dependency.isEmpty()) {
- this.dependencies.add(new PluginDependency(dependency));
- }
- }
+ setDependencies(dependencies.split(","));
+ }
+ }
+
+ return this;
+ }
+
+ protected PluginDescriptor setDependencies(String... dependencies) {
+ for (String dependency : dependencies) {
+ dependency = dependency.trim();
+ if (!dependency.isEmpty()) {
+ this.dependencies.add(new PluginDependency(dependency));
}
}
@@ -209,4 +213,5 @@ public class DefaultPluginDescriptor implements PluginDescriptor {
public int hashCode() {
return Objects.hash(pluginId, pluginDescription, pluginClass, version, requires, provider, dependencies, license);
}
+
}