Skip to content
Snippets Groups Projects
Commit 255d6163 authored by Nils Christian Ehmke's avatar Nils Christian Ehmke
Browse files

Removed some unnecessary code.

parent 42af6a4d
No related branches found
No related tags found
No related merge requests found
......@@ -79,32 +79,17 @@ public class ClassAndMethodContainer {
private Class<?> imageClass;
private Class<?> plainTextClass;
private Class<?> htmlTextClass;
private Method pluginDescriptionMethod;
private Method repositoryDescriptionMethod;
private Method pluginConfigurationMethod;
private Method repositoryConfigurationMethod;
private Method pluginOutputPortsMethod;
private Method pluginRepositoryPortsMethod;
private Method displayNameMethod;
private Method inputPortNameMethod;
private Method outputPortNameMethod;
private Method repositoryPortNameMethod;
private Method propertyNameMethod;
private Method propertyDefaultValueMethod;
private Method plainTextgetTextMethod;
private Method analysisControllerWithMappingGetController;
private Method analysisControllerWithMappingGetMapping;
private Method analysisControllerCreateAnalysisController;
private Method analysisControllerThreadStart;
private Method analysisControllerThreadTerminate;
private Method analysisControllerThreadJoin;
private Method analysisControllerGetState;
private Method propertyDescriptionMethod;
private Method analysisControllerLoadFromFile;
private Method displayDescriptionMethod;
private Method pluginDependenciesMethod;
private Method repositoryDependenciesMethod;
private Method pluginProgrammaticOnlyMethod;
private Method repositoryProgrammaticOnlyMethod;
private Method logImplWebguiLoggingClassGetEntriesMethod;
......@@ -171,28 +156,11 @@ public class ClassAndMethodContainer {
private void loadMethods() throws SecurityException, NoSuchMethodException {
// The following part has to be done carefully: The methods will be loaded via the name
this.pluginDescriptionMethod = this.pluginAnnotationClass.getMethod("description", new Class<?>[0]);
this.repositoryDescriptionMethod = this.repositoryAnnotationClass.getMethod("description", new Class<?>[0]);
this.pluginConfigurationMethod = this.pluginAnnotationClass.getMethod("configuration", new Class<?>[0]);
this.repositoryConfigurationMethod = this.repositoryAnnotationClass.getMethod("configuration", new Class<?>[0]);
this.pluginOutputPortsMethod = this.pluginAnnotationClass.getMethod("outputPorts", new Class<?>[0]);
this.pluginRepositoryPortsMethod = this.pluginAnnotationClass.getMethod("repositoryPorts", new Class<?>[0]);
this.displayNameMethod = this.displayAnnotationClass.getMethod("name", new Class<?>[0]);
this.inputPortNameMethod = this.inputPortAnnotationClass.getMethod("name", new Class<?>[0]);
this.outputPortNameMethod = this.outputPortAnnotationClass.getMethod("name", new Class<?>[0]);
this.repositoryPortNameMethod = this.repositoryPortAnnotationClass.getMethod("name", new Class<?>[0]);
this.propertyNameMethod = this.propertyAnnotationClass.getMethod("name", new Class<?>[0]);
this.propertyDefaultValueMethod = this.propertyAnnotationClass.getMethod("defaultValue", new Class<?>[0]);
this.plainTextgetTextMethod = this.plainTextClass.getMethod("getText", new Class<?>[0]);
this.analysisControllerWithMappingGetController = this.analysisControllerWithMappingClass.getMethod("getController", new Class<?>[0]);
this.analysisControllerWithMappingGetMapping = this.analysisControllerWithMappingClass.getMethod("getPluginMap", new Class<?>[0]);
this.analysisControllerThreadStart = this.analysisControllerThreadClass.getMethod("start", new Class<?>[0]);
this.analysisControllerThreadTerminate = this.analysisControllerThreadClass.getMethod("terminate", new Class<?>[0]);
this.analysisControllerGetState = this.analysisControllerClass.getMethod("getState", new Class<?>[0]);
this.propertyDescriptionMethod = this.propertyAnnotationClass.getMethod("description", new Class<?>[0]);
this.displayDescriptionMethod = this.displayAnnotationClass.getMethod("description", new Class<?>[0]);
this.pluginDependenciesMethod = this.pluginAnnotationClass.getMethod("dependencies", new Class<?>[0]);
this.repositoryDependenciesMethod = this.repositoryAnnotationClass.getMethod("dependencies", new Class<?>[0]);
this.pluginProgrammaticOnlyMethod = this.pluginAnnotationClass.getMethod("programmaticOnly", new Class<?>[0]);
this.repositoryProgrammaticOnlyMethod = this.repositoryAnnotationClass.getMethod("programmaticOnly", new Class<?>[0]);
this.logImplWebguiLoggingClassGetEntriesMethod = this.logImplWebguiLoggingClass.getMethod("getEntries", String.class);
......@@ -261,34 +229,10 @@ public class ClassAndMethodContainer {
return this.displayAnnotationClass;
}
public Method getPluginDescriptionMethod() {
return this.pluginDescriptionMethod;
}
public Method getRepositoryDescriptionMethod() {
return this.repositoryDescriptionMethod;
}
public Method getPluginConfigurationMethod() {
return this.pluginConfigurationMethod;
}
public Method getRepositoryConfigurationMethod() {
return this.repositoryConfigurationMethod;
}
public Method getPluginOutputPortsMethod() {
return this.pluginOutputPortsMethod;
}
public Method getPluginRepositoryPortsMethod() {
return this.pluginRepositoryPortsMethod;
}
public Method getDisplayNameMethod() {
return this.displayNameMethod;
}
public Class<?> getAbstractRepositoryClass() {
return this.abstractRepositoryClass;
}
......@@ -297,26 +241,6 @@ public class ClassAndMethodContainer {
return this.abstractPluginClass;
}
public Method getInputPortNameMethod() {
return this.inputPortNameMethod;
}
public Method getOutputPortNameMethod() {
return this.outputPortNameMethod;
}
public Method getRepositoryPortNameMethod() {
return this.repositoryPortNameMethod;
}
public Method getPropertyNameMethod() {
return this.propertyNameMethod;
}
public Method getPropertyDefaultValueMethod() {
return this.propertyDefaultValueMethod;
}
public Class<?> getImageClass() {
return this.imageClass;
}
......@@ -357,14 +281,6 @@ public class ClassAndMethodContainer {
return this.analysisControllerWithMappingGetController;
}
public Method getAnalysisControllerThreadStart() {
return this.analysisControllerThreadStart;
}
public Method getAnalysisControllerThreadTerminate() {
return this.analysisControllerThreadTerminate;
}
public Method getAnalysisControllerThreadJoin() {
return this.analysisControllerThreadJoin;
}
......@@ -373,10 +289,6 @@ public class ClassAndMethodContainer {
return this.analysisControllerGetState;
}
public Method getPropertyDescriptionMethod() {
return this.propertyDescriptionMethod;
}
public Constructor<?> getAnalysisControllerThreadConstructor() {
return this.analysisControllerThreadConstructor;
}
......@@ -385,18 +297,6 @@ public class ClassAndMethodContainer {
return this.analysisControllerLoadFromFile;
}
public Method getPluginDependenciesMethod() {
return this.pluginDependenciesMethod;
}
public Method getDisplayDescriptionMethod() {
return this.displayDescriptionMethod;
}
public Method getRepositoryDependenciesMethod() {
return this.repositoryDependenciesMethod;
}
public Method getPluginProgrammaticOnlyMethod() {
return this.pluginProgrammaticOnlyMethod;
}
......@@ -465,23 +365,6 @@ public class ClassAndMethodContainer {
return null;
}
/**
* This method can be used to invoke a given method with no parameters, without having to mind about the exceptions. If an exception occurs, the given default
* value will be returned. A call to this method is the same as {@link ClassAndMethodContainer#invokeMethod(Method, Object, Object, Object...)} with
* {@code new Object[0]} as parameters.
*
* @param method
* The method to be invoked.
* @param obj
* The object on which the method will be invoked.
* @param defaultReturn
* The default return value in case of an exception.
* @return The result of the invoked method if everything went well, the default value otherwise.
*/
public static Object invokeMethod(final Method method, final Object obj, final Object defaultReturn) {
return ClassAndMethodContainer.invokeMethod(method, obj, defaultReturn, new Object[0]);
}
/**
* This method can be used to invoke a given <b>class</b>-method with no parameters, without having to mind about the exceptions. If an exception occurs, the
* given default value will be returned. A call to this method is the same as {@link ClassAndMethodContainer#invokeMethod(Method, Object, Object, Object...)}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment