package org.simantics.scl.compiler.internal.decompilation; public class DecompilerFactory { private static boolean initialized; private static IDecompiler DECOMPILER; public static IDecompiler getDecompiler() { if(!initialized) { try { Class clazz = DecompilerFactory.class.getClassLoader().loadClass("org.simantics.scl.compiler.internal.decompiler.impl.DecompilerImpl"); if(clazz != null) { DECOMPILER = (IDecompiler)clazz.newInstance(); } } catch(ClassNotFoundException e) { e.printStackTrace(); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch(NoClassDefFoundError e) { e.printStackTrace(); } initialized = true; } return DECOMPILER; } }