Package org.deuce.transform.asm

Examples of org.deuce.transform.asm.ClassTransformer


   * @throws ClassNotFoundException
   */
  public static void main(String[] args) throws IOException, InstantiationException, IllegalAccessException, SecurityException, NoSuchMethodException, IllegalArgumentException, InvocationTargetException, ClassNotFoundException {
    String clazz = Integer.class.getName();
   
    ClassTransformer rt = new ClassTransformer(Type.getInternalName(Class.forName(clazz)), new HyClassTransformer(Type.getInternalName(Class.forName(clazz))));
//    HyClassTransformer rt = new HyClassTransformer(Type.getInternalName(Class.forName(clazz)));
//    ClassWriter rt = new ClassWriter(0);
    ClassReader cr = new ClassReader(clazz);
    cr.accept(rt, 0);
    byte[] transformed = rt.getClassWritter().toByteArray()
   
//    Class c = new MyClassLoader().defineClass(clazz, transformed);
//    Object o = c.getConstructor(String.class).newInstance("123");
//    c.getMethod("deposit", int.class).invoke(o, 10);
//    c.getMethod("setObjectState", int.class).invoke(o, 4);
View Full Code Here

TOP

Related Classes of org.deuce.transform.asm.ClassTransformer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.