throw new PluginException("Field 'id' cannot be empty");
}
- if (StringUtils.isNullOrEmpty(descriptor.getPluginClass())) {
- throw new PluginException("Field 'class' cannot be empty");
- }
-
if (descriptor.getVersion() == null) {
throw new PluginException("Field 'version' cannot be empty");
}
private String pluginId;
private String pluginDescription;
- private String pluginClass;
+ private String pluginClass = Plugin.class.getName();
private String version;
private String requires = "*"; // SemVer format
private String provider;
dependencies = new ArrayList<>();
}
- /**
- * @param pluginId
- * @param pluginDescription
- * @param pluginClass
- * @param version
- * @param requires
- * @param provider
- * @param license
- */
public DefaultPluginDescriptor(String pluginId, String pluginDescription, String pluginClass, String version, String requires, String provider, String license) {
this();
this.pluginId = pluginId;
}
String clazz = attributes.getValue("Plugin-Class");
- pluginDescriptor.setPluginClass(clazz);
+ if (StringUtils.isNotNullOrEmpty(clazz)) {
+ pluginDescriptor.setPluginClass(clazz);
+ }
String version = attributes.getValue("Plugin-Version");
if (StringUtils.isNotNullOrEmpty(version)) {
*
* @author Decebal Suiu
*/
-public abstract class Plugin {
+public class Plugin {
/**
* Makes logging service available for descending classes.
}
String clazz = properties.getProperty("plugin.class");
- pluginDescriptor.setPluginClass(clazz);
+ if (StringUtils.isNotNullOrEmpty(clazz)) {
+ pluginDescriptor.setPluginClass(clazz);
+ }
String version = properties.getProperty("plugin.version");
if (StringUtils.isNotNullOrEmpty(version)) {