1
|
/**
|
2
|
*
|
3
|
*/
|
4
|
package eu.etaxonomy.taxeditor.store.singlesource;
|
5
|
|
6
|
/**
|
7
|
* @author Lutz Suhrbier
|
8
|
*
|
9
|
*/
|
10
|
public class ImplementationLoader {
|
11
|
|
12
|
public static Object newInstance(final Class<?> type){
|
13
|
String name = type.getName();
|
14
|
Object result = null;
|
15
|
try {
|
16
|
result = type.getClassLoader().loadClass(name + "Impl").newInstance();
|
17
|
} catch (InstantiationException e) {
|
18
|
e.printStackTrace();
|
19
|
} catch (IllegalAccessException e) {
|
20
|
e.printStackTrace();
|
21
|
} catch (ClassNotFoundException e) {
|
22
|
e.printStackTrace();
|
23
|
}
|
24
|
return result;
|
25
|
}
|
26
|
}
|