private int addClassInfo(String className) { return poolWriter.addClassInfo(className.replace('.', '/')); }
private int addClassInfo(String className) { return poolWriter.addClassInfo(className.replace('.', '/')); }
/** * Appends a invokevirtual, inovkespecial, or invokestatic bytecode. * * @see Opcode */ public void addInvoke(int opcode, String targetClass, String methodName, String descriptor) { int target = constPool.addClassInfo(targetClass); int nt = constPool.addNameAndTypeInfo(methodName, descriptor); int method = constPool.addMethodrefInfo(target, nt); add(opcode); add16(method); }
/** * Makes <code>CONSTANT_Class_info</code> objects for each class name. * * @return an array of indexes indicating <code>CONSTANT_Class_info</code>s. */ public int[] addClassInfo(String[] classNames) { int n = classNames.length; int[] result = new int[n]; for (int i = 0; i < n; i++) result[i] = addClassInfo(classNames[i]); return result; }
/** * Appends a invokevirtual, inovkespecial, or invokestatic bytecode. * * @see Opcode */ public void addInvoke(int opcode, String targetClass, String methodName, String descriptor) { int target = constPool.addClassInfo(targetClass); int nt = constPool.addNameAndTypeInfo(methodName, descriptor); int method = constPool.addMethodrefInfo(target, nt); add(opcode); add16(method); }
/** * Appends a invokevirtual, inovkespecial, or invokestatic bytecode. * * @see Opcode */ public void addInvoke(int opcode, String targetClass, String methodName, String descriptor) { int target = constPool.addClassInfo(targetClass); int nt = constPool.addNameAndTypeInfo(methodName, descriptor); int method = constPool.addMethodrefInfo(target, nt); add(opcode); add16(method); }
void addCheckcast(String clazz) { mw.add(Opcode.CHECKCAST); int i = poolWriter.addClassInfo(clazz); addIndex(i); //From Opcode.STACK_GROW[] (see test in main()) //No change to stack }
private void addFieldRefInfo(String className, String fieldName, String type) { addIndex(poolWriter.addFieldrefInfo(poolWriter.addClassInfo(className), poolWriter.addNameAndTypeInfo(fieldName, type))); }
private void addFieldRefInfo(String className, String fieldName, String type) { addIndex(poolWriter.addFieldrefInfo(poolWriter.addClassInfo(className), poolWriter.addNameAndTypeInfo(fieldName, type))); }
/** * Makes <code>CONSTANT_Class_info</code> objects for each class name. * * @return an array of indexes indicating <code>CONSTANT_Class_info</code>s. */ public int[] addClassInfo(String[] classNames) { int n = classNames.length; int[] result = new int[n]; for (int i = 0; i < n; i++) result[i] = addClassInfo(classNames[i]); return result; }
void addCheckcast(String clazz) { mw.add(Opcode.CHECKCAST); int i = poolWriter.addClassInfo(clazz); addIndex(i); //From Opcode.STACK_GROW[] (see test in main()) //No change to stack }
/** * Appends a invokevirtual, inovkespecial, or invokestatic bytecode. * * @see Opcode */ public void addInvoke(int opcode, String targetClass, String methodName, String descriptor) { int target = constPool.addClassInfo(targetClass); int nt = constPool.addNameAndTypeInfo(methodName, descriptor); int method = constPool.addMethodrefInfo(target, nt); add(opcode); add16(method); }
/** * Makes <code>CONSTANT_Class_info</code> objects for each class name. * * @return an array of indexes indicating <code>CONSTANT_Class_info</code>s. */ public int[] addClassInfo(String[] classNames) { int n = classNames.length; int[] result = new int[n]; for (int i = 0; i < n; i++) result[i] = addClassInfo(classNames[i]); return result; }
/** * Makes <code>CONSTANT_Class_info</code> objects for each class name. * * @return an array of indexes indicating <code>CONSTANT_Class_info</code>s. */ public int[] addClassInfo(String[] classNames) { int n = classNames.length; int[] result = new int[n]; for (int i = 0; i < n; i++) result[i] = addClassInfo(classNames[i]); return result; }
/** * Starts Adding a new method. * * @param accessFlags access flags. * @param name the method name. * @param descriptor the method signature. * @param exceptions throws clause. It may be null. * The class names must be the JVM-internal * representations like <code>java/lang/Exception</code>. * @param aw attributes to the <code>Method_info</code>. */ public void begin(int accessFlags, String name, String descriptor, String[] exceptions, AttributeWriter aw) { int nameIndex = constPool.addUtf8Info(name); int descIndex = constPool.addUtf8Info(descriptor); int[] intfs; if (exceptions == null) intfs = null; else intfs = constPool.addClassInfo(exceptions); begin(accessFlags, nameIndex, descIndex, intfs, aw); }
/** * Appends a invokevirtual, inovkespecial, or invokestatic bytecode. * * @see Opcode */ public void addInvoke(int opcode, String targetClass, String methodName, String descriptor) { int target = constPool.addClassInfo(targetClass); int nt = constPool.addNameAndTypeInfo(methodName, descriptor); int method = constPool.addMethodrefInfo(target, nt); add(opcode); add16(method); }
/** * Makes <code>CONSTANT_Class_info</code> objects for each class name. * * @return an array of indexes indicating <code>CONSTANT_Class_info</code>s. */ public int[] addClassInfo(String[] classNames) { int n = classNames.length; int[] result = new int[n]; for (int i = 0; i < n; i++) result[i] = addClassInfo(classNames[i]); return result; }
/** * Starts Adding a new method. * * @param accessFlags access flags. * @param name the method name. * @param descriptor the method signature. * @param exceptions throws clause. It may be null. * The class names must be the JVM-internal * representations like <code>java/lang/Exception</code>. * @param aw attributes to the <code>Method_info</code>. */ public void begin(int accessFlags, String name, String descriptor, String[] exceptions, AttributeWriter aw) { int nameIndex = constPool.addUtf8Info(name); int descIndex = constPool.addUtf8Info(descriptor); int[] intfs; if (exceptions == null) intfs = null; else intfs = constPool.addClassInfo(exceptions); begin(accessFlags, nameIndex, descIndex, intfs, aw); }
/** * Appends a invokevirtual, inovkespecial, or invokestatic bytecode. * * @see Opcode */ public void addInvoke(int opcode, String targetClass, String methodName, String descriptor) { int target = constPool.addClassInfo(targetClass); int nt = constPool.addNameAndTypeInfo(methodName, descriptor); int method = constPool.addMethodrefInfo(target, nt); add(opcode); add16(method); }
/** * Makes <code>CONSTANT_Class_info</code> objects for each class name. * * @return an array of indexes indicating <code>CONSTANT_Class_info</code>s. */ public int[] addClassInfo(String[] classNames) { int n = classNames.length; int[] result = new int[n]; for (int i = 0; i < n; i++) result[i] = addClassInfo(classNames[i]); return result; }