forked from SteamWar/SteamWar
Format code
This commit is contained in:
@@ -22,12 +22,14 @@ package de.steamwar;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
public class ImplementationProvider {
|
||||
private ImplementationProvider() {}
|
||||
private ImplementationProvider() {
|
||||
}
|
||||
|
||||
public static <T> T getImpl(String className) {
|
||||
try {
|
||||
return (T) Class.forName(className).getDeclaredConstructor().newInstance();
|
||||
} catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException | ClassNotFoundException e) {
|
||||
} catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException |
|
||||
ClassNotFoundException e) {
|
||||
throw new SecurityException("Could not load implementation", e);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user