
org.meridor.stecker.PluginException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of stecker-plugin-loader Show documentation
Show all versions of stecker-plugin-loader Show documentation
This is a plugin loading library. Its main purpose is to load extension point implementations from
provided plugins.
package org.meridor.stecker;
import org.meridor.stecker.interfaces.DependencyProblem;
import java.util.Optional;
/**
* An generic exception thrown when something goes wrong with plugins
*/
public class PluginException extends Exception {
private Optional dependencyProblem = Optional.empty();
private Optional pluginMetadata = Optional.empty();
public PluginException(Exception e) {
super(e);
}
public PluginException(String message) {
super(message);
}
public PluginException(String message, Exception e) {
super(message, e);
}
public PluginException withDependencyProblem(DependencyProblem dependencyProblem) {
this.dependencyProblem = Optional.ofNullable(dependencyProblem);
return this;
}
public PluginException withPlugin(PluginMetadata pluginMetadata) {
this.pluginMetadata = Optional.ofNullable(pluginMetadata);
return this;
}
/**
* Returns dependency problem if any
*
* @return dependency problem
*/
public Optional getDependencyProblem() {
return dependencyProblem;
}
/**
* Returns plugin affected
*
* @return plugin metadata
*/
public Optional getPluginMetadata() {
return pluginMetadata;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy