protected TraceAnnotationVisitor createTraceAnnotationVisitor() { return new TraceAnnotationVisitor(); }
public void visit(final String name, final Object value) { buf.setLength(0); appendComa(valueNumber++); visitString((String) value); } else if (value instanceof Type) { visitType((Type) value); } else if (value instanceof Byte) { visitByte(((Byte) value).byteValue()); } else if (value instanceof Boolean) { visitBoolean(((Boolean) value).booleanValue()); } else if (value instanceof Short) { visitShort(((Short) value).shortValue()); } else if (value instanceof Character) { visitChar(((Character) value).charValue()); } else if (value instanceof Integer) { visitInt(((Integer) value).intValue()); } else if (value instanceof Float) { visitFloat(((Float) value).floatValue()); } else if (value instanceof Long) { visitLong(((Long) value).longValue()); } else if (value instanceof Double) { visitDouble(((Double) value).doubleValue()); } else if (value.getClass().isArray()) { buf.append('{'); byte[] v = (byte[]) value; for (int i = 0; i < v.length; i++) { appendComa(i); visitByte(v[i]);
public AnnotationVisitor visitAnnotation( final String name, final String desc) { buf.setLength(0); appendComa(valueNumber++); if (name != null) { buf.append(name).append('='); } buf.append('@'); appendDescriptor(FIELD_DESCRIPTOR, desc); buf.append('('); text.add(buf.toString()); TraceAnnotationVisitor tav = createTraceAnnotationVisitor(); text.add(tav.getText()); text.add(")"); if (av != null) { tav.av = av.visitAnnotation(name, desc); } return tav; }
public AnnotationVisitor visitArray(final String name) { buf.setLength(0); appendComa(valueNumber++); if (name != null) { buf.append(name).append('='); } buf.append('{'); text.add(buf.toString()); TraceAnnotationVisitor tav = createTraceAnnotationVisitor(); text.add(tav.getText()); text.add("}"); if (av != null) { tav.av = av.visitArray(name); } return tav; }
public void visitEnum( final String name, final String desc, final String value) { buf.setLength(0); appendComa(valueNumber++); if (name != null) { buf.append(name).append('='); } appendDescriptor(FIELD_DESCRIPTOR, desc); buf.append('.').append(value); text.add(buf.toString()); if (av != null) { av.visitEnum(name, desc, value); } }
public AnnotationVisitor visitAnnotationDefault() { text.add(tab2 + "default="); TraceAnnotationVisitor tav = createTraceAnnotationVisitor(); text.add(tav.getText()); text.add("\n"); if (mv != null) { tav.av = mv.visitAnnotationDefault(); } return tav; }
private void visitString(final String value) { appendString(buf, value); }
public AnnotationVisitor visitArray(final String name) { buf.setLength(0); appendComa(valueNumber++); if (name != null) { buf.append(name).append('='); } buf.append('{'); text.add(buf.toString()); TraceAnnotationVisitor tav = createTraceAnnotationVisitor(); text.add(tav.getText()); text.add("}"); if (av != null) { tav.av = av.visitArray(name); } return tav; }
public void visitEnum( final String name, final String desc, final String value) { buf.setLength(0); appendComa(valueNumber++); if (name != null) { buf.append(name).append('='); } appendDescriptor(FIELD_DESCRIPTOR, desc); buf.append('.').append(value); text.add(buf.toString()); if (av != null) { av.visitEnum(name, desc, value); } }
/** * Prints a disassembled view of 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(tab).append('@'); appendDescriptor(FIELD_DESCRIPTOR, desc); buf.append('('); text.add(buf.toString()); TraceAnnotationVisitor tav = createTraceAnnotationVisitor(); text.add(tav.getText()); text.add(visible ? ")\n" : ") // invisible\n"); return tav; }
private void visitString(final String value) { appendString(buf, value); }
public void visit(final String name, final Object value) { buf.setLength(0); appendComa(valueNumber++); visitString((String) value); } else if (value instanceof Type) { visitType((Type) value); } else if (value instanceof Byte) { visitByte(((Byte) value).byteValue()); } else if (value instanceof Boolean) { visitBoolean(((Boolean) value).booleanValue()); } else if (value instanceof Short) { visitShort(((Short) value).shortValue()); } else if (value instanceof Character) { visitChar(((Character) value).charValue()); } else if (value instanceof Integer) { visitInt(((Integer) value).intValue()); } else if (value instanceof Float) { visitFloat(((Float) value).floatValue()); } else if (value instanceof Long) { visitLong(((Long) value).longValue()); } else if (value instanceof Double) { visitDouble(((Double) value).doubleValue()); } else if (value.getClass().isArray()) { buf.append('{'); byte[] v = (byte[]) value; for (int i = 0; i < v.length; i++) { appendComa(i); visitByte(v[i]);
public AnnotationVisitor visitAnnotation( final String name, final String desc) { buf.setLength(0); appendComa(valueNumber++); if (name != null) { buf.append(name).append('='); } buf.append('@'); appendDescriptor(FIELD_DESCRIPTOR, desc); buf.append('('); text.add(buf.toString()); TraceAnnotationVisitor tav = createTraceAnnotationVisitor(); text.add(tav.getText()); text.add(")"); if (av != null) { tav.av = av.visitAnnotation(name, desc); } return tav; }
public AnnotationVisitor visitParameterAnnotation( final int parameter, final String desc, final boolean visible) { buf.setLength(0); buf.append(tab2).append('@'); appendDescriptor(FIELD_DESCRIPTOR, desc); buf.append('('); text.add(buf.toString()); TraceAnnotationVisitor tav = createTraceAnnotationVisitor(); text.add(tav.getText()); text.add(visible ? ") // parameter " : ") // invisible, parameter "); text.add(new Integer(parameter)); text.add("\n"); if (mv != null) { tav.av = mv.visitParameterAnnotation(parameter, desc, visible); } return tav; }
protected TraceAnnotationVisitor createTraceAnnotationVisitor() { return new TraceAnnotationVisitor(); }
public AnnotationVisitor visitAnnotationDefault() { text.add(tab2 + "default="); TraceAnnotationVisitor tav = createTraceAnnotationVisitor(); text.add(tav.getText()); text.add("\n"); if (mv != null) { tav.av = mv.visitAnnotationDefault(); } return tav; }
public AnnotationVisitor visitParameterAnnotation( final int parameter, final String desc, final boolean visible) { buf.setLength(0); buf.append(tab2).append('@'); appendDescriptor(FIELD_DESCRIPTOR, desc); buf.append('('); text.add(buf.toString()); TraceAnnotationVisitor tav = createTraceAnnotationVisitor(); text.add(tav.getText()); text.add(visible ? ") // parameter " : ") // invisible, parameter "); text.add(new Integer(parameter)); text.add("\n"); if (mv != null) { tav.av = mv.visitParameterAnnotation(parameter, desc, visible); } return tav; }
/** * Prints a disassembled view of 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(tab).append('@'); appendDescriptor(FIELD_DESCRIPTOR, desc); buf.append('('); text.add(buf.toString()); TraceAnnotationVisitor tav = createTraceAnnotationVisitor(); text.add(tav.getText()); text.add(visible ? ")\n" : ") // invisible\n"); return tav; }