Package org.deuce.objectweb.asm

Examples of org.deuce.objectweb.asm.ClassWriter


  final private String className;
  private ExternalMethodVisitor staticMethod;
 
  public ExternalFieldsHolder(String className){
    this.className = getFieldsHolderName(className);
    this.classWriter = new ClassWriter(ClassWriter.COMPUTE_MAXS | ClassWriter.COMPUTE_FRAMES);
  }
View Full Code Here


    super(classWriter);
    this.className = className;
  }
 
  public ByteCodeVisitor( String className, HashMap<Object, ArrayList<Object>> rmD) {
    this(className, new ClassWriter( ClassWriter.COMPUTE_MAXS));
    rmd = rmD;
  }
View Full Code Here

    this(className, new ClassWriter( ClassWriter.COMPUTE_MAXS));
    rmd = rmD;
  }
 
  public ByteCodeVisitor(String className2) {
    this(className2, new ClassWriter( ClassWriter.COMPUTE_FRAMES));
  }
View Full Code Here

   
    //Test & Print the newly implemented class, only if print requested
    String print = System.getProperty("bytecodePrint", "false");
    if(Boolean.parseBoolean(print)){
      ClassReader cr3 = new ClassReader(((ClassWriter)cv).toByteArray());
      ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
      PrintWriter writer = new PrintWriter(System.out);
      CheckClassAdapter cv = new CheckClassAdapter(cw);
      TraceClassVisitor tcv = new TraceClassVisitor(cv, writer );
      cr3.accept(tcv, ClassReader.EXPAND_FRAMES);
      byte[] newFile = cw.toByteArray();
      return newFile;
    }
   
    return ((ClassWriter)super.cv).toByteArray();
 
View Full Code Here

public class ProxyImplementation implements Opcodes{

  public static byte[] getCode(ArrayList<Object> remoteDetails, String className) {
    ClassDetails cD = new ClassDetails();
    cD.update(className);
    ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES);
    String[] iF = {"java/rmi/Remote","java/io/Serializable"};
    cw.visit(V1_6, ACC_PUBLIC,className, null,  "java/rmi/server/UnicastRemoteObject",iF);
    ProxyImpl.addCode(remoteDetails, cw, cD);
    cw.visitEnd();
    //Test Generated Class
    ClassReader cr3 = new ClassReader(cw.toByteArray());
    ClassWriter cw1 = new ClassWriter(ClassWriter.COMPUTE_MAXS);
    PrintWriter writer = new PrintWriter(System.out);
    CheckClassAdapter cv = new CheckClassAdapter(cw);
    TraceClassVisitor tcv = new TraceClassVisitor(cv, writer );
    cr3.accept(tcv, ClassReader.EXPAND_FRAMES);
    return cw1.toByteArray();   
  }
View Full Code Here

import org.deuce.transform.asm.storage.MethodDetails;

public class ProxyInterfaceCode implements Opcodes{

  public static byte[] getCode(ArrayList<Object> remoteDetails, String className) {
    ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES);
    String[] iF = {"java/rmi/Remote","java/io/Serializable"};
    cw.visit(V1_6, ACC_PUBLIC + ACC_ABSTRACT + ACC_INTERFACE, className, null, "java/lang/Object",iF);
    cw.visitSource("$HY$_IBankAccount.java", null);
    ProxyInterface.addCode(remoteDetails, cw)
    cw.visitEnd();
    //Test Generated Class
    ClassReader cr3 = new ClassReader(cw.toByteArray());
    ClassWriter cw1 = new ClassWriter(ClassWriter.COMPUTE_MAXS);
    PrintWriter writer = new PrintWriter(System.out);
    CheckClassAdapter cv = new CheckClassAdapter(cw);
    TraceClassVisitor tcv = new TraceClassVisitor(cv, writer );
    cr3.accept(tcv, ClassReader.EXPAND_FRAMES);
    return cw1.toByteArray();   
  }
View Full Code Here

TOP

Related Classes of org.deuce.objectweb.asm.ClassWriter

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.