/** * Init the static methods. */ public static void init(ClassLoader classloader) { try { Class nug = SReflect.classForName("nuggets.Nuggets", classloader); otx = nug.getMethod("objectToXML", new Class[]{Object.class, ClassLoader.class}); ofx = nug.getMethod("objectFromXML", new Class[]{String.class, ClassLoader.class}); } catch(Exception e) { throw new RuntimeException("Nuggets not in classpath.", e); } }
/** * Init the static methods. */ public static void init(ClassLoader classloader) { try { Class nug = SReflect.classForName("nuggets.Nuggets", classloader); otx = nug.getMethod("objectToXML", new Class[]{Object.class, ClassLoader.class}); ofx = nug.getMethod("objectFromXML", new Class[]{String.class, ClassLoader.class}); } catch(Exception e) { throw new RuntimeException("Nuggets not in classpath.", e); } }
/** * Init the static methods. */ public static void init(ClassLoader classloader) { try { Class nug = SReflect.classForName("nuggets.Nuggets", classloader); otx = nug.getMethod("objectToXML", new Class[]{Object.class, ClassLoader.class}); ofx = nug.getMethod("objectFromXML", new Class[]{String.class, ClassLoader.class}); } catch(Exception e) { throw new RuntimeException("Nuggets not in classpath.", e); } }
/** * Init the static methods. */ public static void init(ClassLoader classloader) { try { Class nug = SReflect.classForName("nuggets.Nuggets", classloader); otx = nug.getMethod("objectToXML", new Class[]{Object.class, ClassLoader.class}); ofx = nug.getMethod("objectFromXML", new Class[]{String.class, ClassLoader.class}); } catch(Exception e) { throw new RuntimeException("Nuggets not in classpath.", e); } }
/** * Init the static methods. */ public static void init(ClassLoader classloader) { try { Class nug = SReflect.classForName("nuggets.Nuggets", classloader); otx = nug.getMethod("objectToXML", new Class[]{Object.class, ClassLoader.class}); ofx = nug.getMethod("objectFromXML", new Class[]{String.class, ClassLoader.class}); } catch(Exception e) { throw new RuntimeException("Nuggets not in classpath.", e); } }
/** * Init the static methods. */ public static void init(ClassLoader classloader) { try { Class nug = SReflect.classForName("nuggets.Nuggets", classloader); otx = nug.getMethod("objectToXML", new Class[]{Object.class, ClassLoader.class}); ofx = nug.getMethod("objectFromXML", new Class[]{String.class, ClassLoader.class}); } catch(Exception e) { throw new RuntimeException("Nuggets not in classpath.", e); } }
public Object createObject(IContext context, Map rawattributes) throws Exception { return SReflect.classForName((String)rawattributes.get("classname"), context.getClassLoader()); } }),
public Object createObject(IContext context, Map rawattributes) throws Exception { String tmp = (String)rawattributes.get("content"); int idx = tmp.indexOf("="); String classname = tmp.substring(0, idx); String name = tmp.substring(idx+1); Class clazz = SReflect.classForName(classname, context.getClassLoader()); return Enum.valueOf(clazz, name); } }),
ret = Enum.valueOf((Class<Enum>)SReflect.classForName(ret.getClass().getName(), cl), ret.toString());
ret = Enum.valueOf((Class<Enum>)SReflect.classForName(ret.getClass().getName(), cl), ret.toString());
try clz = SReflect.classForName("jadex.xml.reader.XMLReaderFactoryAndroid", null); if (clz != null) { INSTANCE = (XMLReaderFactory) clz.newInstance();
Class<?> starterclass = SReflect.classForName(Starter.class.getName(), classpath.getClassLoader()); starterclass.getMethod("createPlatform", new Class<?>[]{String[].class}). invoke(null, new Object[]{args.toArray(new String[args.size()])});
/** * Creates the object during decoding. * * @param clazz The class of the object. * @param context The decoding context. * @return The created object. */ public Object createObject(Class<?> clazz, IDecodingContext context) { Class ret = null; try { ret = SReflect.classForName(context.readClassname(), context.getClassloader()); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } return ret; }
/** * Start a java process. */ public static void startJavaProcess(String[] parts, OutputStream out, OutputStream err) { // System.out.println("starting java in procs: "+SUtil.arrayToString(parts)); try { // empty streams of this process to dev null // System.setOut(new PrintStream(System.out)); // System.setErr(new PrintStream(System.err)); System.setOut(new PrintStream(out)); System.setErr(new PrintStream(err)); new Thread(new StreamCopy(System.in, new NullOutputStream())).start(); // String[] parts = SUtil.splitCommandline(cmd); String[] args = new String[parts.length-1]; System.arraycopy(parts, 1, args, 0, parts.length-1); Class<?> mcl = SReflect.classForName(parts[0], null); Method m = mcl.getMethod("main", new Class[]{String[].class}); m.invoke(null, new Object[]{args}); } catch(Exception ex) { ex.printStackTrace(); throw new RuntimeException("Could not start process. Reason: "+ ex.getMessage()); } }
try clz = SReflect.classForName("jadex.xml.writer.XMLWriterFactoryAndroid", null); if(clz != null)
try clz = SReflect.classForName("jadex.bdiv3.BDIClassGeneratorFactoryAndroid", null); if(clz != null)
try clz = SReflect.classForName("jadex.bdiv3.BDIClassGeneratorFactoryAndroid", null); if(clz != null)
try Class<?> cfclass = SReflect.classForName(factory, cl); Class<?> rlclass = SReflect.classForName(IResultListener.class.getName(), cl); Object cfac = cfclass.getConstructor(new Class[]{String.class}).newInstance(new Object[]{"dummy"});
/** * Creates the object during decoding. * * @param clazz The class of the object. * @param context The decoding context. * @return The created object. */ public Object createObject(Class clazz, IDecodingContext context) { Method ret = null; try { Class<?> methodclass = SReflect.classForName(context.readClassname(), context.getClassloader()); String methodname = context.readString(); Class<?>[] params = (Class<?>[]) BinarySerializer.decodeObject(context); ret = methodclass.getMethod(methodname, params); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } catch (NoSuchMethodException e) { throw new RuntimeException(e); } return ret; }
Class<?> clazz = SReflect.classForName(taskname, modelcontainer.getProjectClassLoader());