/** * Appends a string representation of the given constant to the given * buffer. * * @param cst an {@link Integer}, {@link Float}, {@link Long}, * {@link Double} or {@link String} object. May be <tt>null</tt>. */ void appendConstant(final Object cst) { appendConstant(buf, cst); }
buf.append("null"); } else if (cst instanceof String) { appendString(buf, (String) cst); } else if (cst instanceof Type) { buf.append("Type.getType(\"");
public void visit(final String name, final Object value) { buf.setLength(0); buf.append("av").append(id).append(".visit("); ASMifierAbstractVisitor.appendConstant(buf, name); buf.append(", "); ASMifierAbstractVisitor.appendConstant(buf, value); buf.append(");\n"); text.add(buf.toString()); }
buf.append("null"); } else if (cst instanceof String) { appendString(buf, (String) cst); } else if (cst instanceof Type) { buf.append("Type.getType(\"");
public void visitEnum( final String name, final String desc, final String value) { buf.setLength(0); buf.append("av").append(id).append(".visitEnum("); ASMifierAbstractVisitor.appendConstant(buf, name); buf.append(", "); ASMifierAbstractVisitor.appendConstant(buf, desc); buf.append(", "); ASMifierAbstractVisitor.appendConstant(buf, value); buf.append(");\n"); text.add(buf.toString()); }
public AnnotationVisitor visitArray(final String name) { buf.setLength(0); buf.append("{\n"); buf.append("AnnotationVisitor av").append(id + 1).append(" = av"); buf.append(id).append(".visitArray("); ASMifierAbstractVisitor.appendConstant(buf, name); buf.append(");\n"); text.add(buf.toString()); ASMifierAnnotationVisitor av = new ASMifierAnnotationVisitor(id + 1); text.add(av.getText()); text.add("}\n"); return av; }
public AnnotationVisitor visitAnnotation( final String name, final String desc) { buf.setLength(0); buf.append("{\n"); buf.append("AnnotationVisitor av").append(id + 1).append(" = av"); buf.append(id).append(".visitAnnotation("); ASMifierAbstractVisitor.appendConstant(buf, name); buf.append(", "); ASMifierAbstractVisitor.appendConstant(buf, desc); buf.append(");\n"); text.add(buf.toString()); ASMifierAnnotationVisitor av = new ASMifierAnnotationVisitor(id + 1); text.add(av.getText()); text.add("}\n"); return av; }
/** * Prints the ASM code that generates the given annotation. * * @param desc the class descriptor of the annotation class. * @param visible <tt>true</tt> if the annotation is visible at runtime. * @return a visitor to visit the annotation values. */ public AnnotationVisitor visitAnnotation( final String desc, final boolean visible) { buf.setLength(0); buf.append("{\n") .append("av0 = ") .append(name) .append(".visitAnnotation("); appendConstant(desc); buf.append(", ").append(visible).append(");\n"); text.add(buf.toString()); ASMifierAnnotationVisitor av = new ASMifierAnnotationVisitor(0); text.add(av.getText()); text.add("}\n"); return av; }
/** * Appends a string representation of the given constant to the given * buffer. * * @param cst an {@link Integer}, {@link Float}, {@link Long}, * {@link Double} or {@link String} object. May be <tt>null</tt>. */ void appendConstant(final Object cst) { appendConstant(buf, cst); }
public void visit(final String name, final Object value) { buf.setLength(0); buf.append("av").append(id).append(".visit("); ASMifierAbstractVisitor.appendConstant(buf, name); buf.append(", "); ASMifierAbstractVisitor.appendConstant(buf, value); buf.append(");\n"); text.add(buf.toString()); }
public void visitEnum( final String name, final String desc, final String value) { buf.setLength(0); buf.append("av").append(id).append(".visitEnum("); ASMifierAbstractVisitor.appendConstant(buf, name); buf.append(", "); ASMifierAbstractVisitor.appendConstant(buf, desc); buf.append(", "); ASMifierAbstractVisitor.appendConstant(buf, value); buf.append(");\n"); text.add(buf.toString()); }
public AnnotationVisitor visitArray(final String name) { buf.setLength(0); buf.append("{\n"); buf.append("AnnotationVisitor av").append(id + 1).append(" = av"); buf.append(id).append(".visitArray("); ASMifierAbstractVisitor.appendConstant(buf, name); buf.append(");\n"); text.add(buf.toString()); ASMifierAnnotationVisitor av = new ASMifierAnnotationVisitor(id + 1); text.add(av.getText()); text.add("}\n"); return av; }
public AnnotationVisitor visitAnnotation( final String name, final String desc) { buf.setLength(0); buf.append("{\n"); buf.append("AnnotationVisitor av").append(id + 1).append(" = av"); buf.append(id).append(".visitAnnotation("); ASMifierAbstractVisitor.appendConstant(buf, name); buf.append(", "); ASMifierAbstractVisitor.appendConstant(buf, desc); buf.append(");\n"); text.add(buf.toString()); ASMifierAnnotationVisitor av = new ASMifierAnnotationVisitor(id + 1); text.add(av.getText()); text.add("}\n"); return av; }
/** * Prints the ASM code that generates the given annotation. * * @param desc the class descriptor of the annotation class. * @param visible <tt>true</tt> if the annotation is visible at runtime. * @return a visitor to visit the annotation values. */ public AnnotationVisitor visitAnnotation( final String desc, final boolean visible) { buf.setLength(0); buf.append("{\n") .append("av0 = ") .append(name) .append(".visitAnnotation("); appendConstant(desc); buf.append(", ").append(visible).append(");\n"); text.add(buf.toString()); ASMifierAnnotationVisitor av = new ASMifierAnnotationVisitor(0); text.add(av.getText()); text.add("}\n"); return av; }