public ElementValuePairGen(final String name, final ElementValueGen value, final ConstantPoolGen cpool) { this.nameIdx = cpool.addUtf8(name); this.value = value; this.cpool = cpool; }
public AnnotationEntryGen(final ObjectType type, final List<ElementValuePairGen> elements, final boolean vis, final ConstantPoolGen cpool) { this.cpool = cpool; this.typeIndex = cpool.addUtf8(type.getSignature()); evs = elements; isRuntimeVisible = vis; }
public ClassElementValueGen(final ObjectType t, final ConstantPoolGen cpool) { super(ElementValueGen.CLASS, cpool); // this.idx = cpool.addClass(t); idx = cpool.addUtf8(t.getSignature()); }
public SimpleElementValueGen(final int type, final ConstantPoolGen cpGen, final String value) { super(type, cpGen); idx = getConstantPool().addUtf8(value); }
/** * @return `Exceptions' attribute of all the exceptions thrown by this method. */ private ExceptionTable getExceptionTable( final ConstantPoolGen cp ) { final int size = throws_vec.size(); final int[] ex = new int[size]; for (int i = 0; i < size; i++) { ex[i] = cp.addClass(throws_vec.get(i)); } return new ExceptionTable(cp.addUtf8("Exceptions"), 2 + 2 * size, ex, cp.getConstantPool()); }
/** * @return `LineNumberTable' attribute of all the local variables of this method. */ public LineNumberTable getLineNumberTable( final ConstantPoolGen cp ) { final int size = line_number_vec.size(); final LineNumber[] ln = new LineNumber[size]; for (int i = 0; i < size; i++) { ln[i] = line_number_vec.get(i).getLineNumber(); } return new LineNumberTable(cp.addUtf8("LineNumberTable"), 2 + ln.length * 4, ln, cp .getConstantPool()); }
/** * @return `LineNumberTable' attribute of all the local variables of this method. */ public LineNumberTable getLineNumberTable(ConstantPoolGen cp) { int size = line_number_vec.size(); LineNumber[] ln = new LineNumber[size]; try { for(int i=0; i < size; i++) ln[i] = ((LineNumberGen)line_number_vec.get(i)).getLineNumber(); } catch(ArrayIndexOutOfBoundsException e) {} // Never occurs return new LineNumberTable(cp.addUtf8("LineNumberTable"), 2 + ln.length * 4, ln, cp.getConstantPool()); }
private int addClass_( final String clazz ) { int ret; if ((ret = lookupClass(clazz)) != -1) { return ret; // Already in CP } adjustSize(); final ConstantClass c = new ConstantClass(addUtf8(clazz)); ret = index; constants[index++] = c; if (!class_table.containsKey(clazz)) { class_table.put(clazz, new Index(ret)); } return ret; }
private int addClass_(String clazz) { int ret; if((ret = lookupClass(clazz)) != -1) return ret; // Already in CP adjustSize(); ConstantClass c = new ConstantClass(addUtf8(clazz)); ret = index; constants[index++] = c; class_table.put(clazz, new Index(ret)); return ret; }
/** * @return `LocalVariableTable' attribute of all the local variables of this method. */ public LocalVariableTable getLocalVariableTable(ConstantPoolGen cp) { LocalVariableGen[] lg = getLocalVariables(); int size = lg.length; LocalVariable[] lv = new LocalVariable[size]; for(int i=0; i < size; i++) lv[i] = lg[i].getLocalVariable(cp); return new LocalVariableTable(cp.addUtf8("LocalVariableTable"), 2 + lv.length * 10, lv, cp.getConstantPool()); }