private int readAnnotationValue(int v,final char[] buf,final String name,final AnnotationVisitor av){
  int i;
  if (av == null) {
switch (b[v] & 0xFF) {
case 'e':
      return v + 5;
case '@':
    return readAnnotationValues(v + 3,buf,true,null);
case '[':
  return readAnnotationValues(v + 1,buf,false,null);
default :
return v + 3;
}
}
switch (b[v++] & 0xFF) {
case 'I':
case 'J':
case 'F':
case 'D':
av.visit(name,readConst(readUnsignedShort(v),buf));
v+=2;
break;
case 'B':
av.visit(name,(byte)readInt(items[readUnsignedShort(v)]));
v+=2;
break;
case 'Z':
av.visit(name,readInt(items[readUnsignedShort(v)]) == 0 ? Boolean.FALSE : Boolean.TRUE);
v+=2;
break;
case 'S':
av.visit(name,(short)readInt(items[readUnsignedShort(v)]));
v+=2;
break;
case 'C':
av.visit(name,(char)readInt(items[readUnsignedShort(v)]));
v+=2;
break;
case 's':
av.visit(name,readUTF8(v,buf));
v+=2;
break;
case 'e':
av.visitEnum(name,readUTF8(v,buf),readUTF8(v + 2,buf));
v+=4;
break;
case 'c':
av.visit(name,Type.getType(readUTF8(v,buf)));
v+=2;
break;
case '@':
v=readAnnotationValues(v + 2,buf,true,av.visitAnnotation(name,readUTF8(v,buf)));
break;
case '[':
int size=readUnsignedShort(v);
v+=2;
if (size == 0) {
return readAnnotationValues(v - 2,buf,false,av.visitArray(name));
}
switch (this.b[v++] & 0xFF) {
case 'B':
byte[] bv=new byte[size];
for (i=0; i < size; i++) {
bv[i]=(byte)readInt(items[readUnsignedShort(v)]);
v+=3;
}
av.visit(name,bv);
--v;
break;
case 'Z':
boolean[] zv=new boolean[size];
for (i=0; i < size; i++) {
zv[i]=readInt(items[readUnsignedShort(v)]) != 0;
v+=3;
}
av.visit(name,zv);
--v;
break;
case 'S':
short[] sv=new short[size];
for (i=0; i < size; i++) {
sv[i]=(short)readInt(items[readUnsignedShort(v)]);
v+=3;
}
av.visit(name,sv);
--v;
break;
case 'C':
char[] cv=new char[size];
for (i=0; i < size; i++) {
cv[i]=(char)readInt(items[readUnsignedShort(v)]);
v+=3;
}
av.visit(name,cv);
--v;
break;
case 'I':
int[] iv=new int[size];
for (i=0; i < size; i++) {
iv[i]=readInt(items[readUnsignedShort(v)]);
v+=3;
}
av.visit(name,iv);
--v;
break;
case 'J':
long[] lv=new long[size];
for (i=0; i < size; i++) {
lv[i]=readLong(items[readUnsignedShort(v)]);
v+=3;
}
av.visit(name,lv);
--v;
break;
case 'F':
float[] fv=new float[size];
for (i=0; i < size; i++) {
fv[i]=Float.intBitsToFloat(readInt(items[readUnsignedShort(v)]));
v+=3;
}
av.visit(name,fv);
--v;
break;
case 'D':
double[] dv=new double[size];
for (i=0; i < size; i++) {
dv[i]=Double.longBitsToDouble(readLong(items[readUnsignedShort(v)]));
v+=3;
}
av.visit(name,dv);
--v;
break;
default :
v=readAnnotationValues(v - 3,buf,false,av.visitArray(name));
}
}
return v;
}

private int readAnnotationValue ( int v , final char [ ] buf , final String name , final AnnotationVisitor av ) { int i ; if ( av == null ) { switch ( b [ v ] & 0xFF ) { case 'e' : return v + 5 ; case '@' : return readAnnotationValues ( v + 3 , buf , true , null ) ; case '[' : return readAnnotationValues ( v + 1 , buf , false , null ) ; default : return v + 3 ; } } switch ( b [ v ++ ] & 0xFF ) { case 'I' : case 'J' : case 'F' : case 'D' : av . visit ( name , readConst ( readUnsignedShort ( v ) , buf ) ) ; v += 2 ; break ; case 'B' : av . visit ( name , ( byte ) readInt ( items [ readUnsignedShort ( v ) ] ) ) ; v += 2 ; break ; case 'Z' : av . visit ( name , readInt ( items [ readUnsignedShort ( v ) ] ) == 0 ? Boolean . FALSE : Boolean . TRUE ) ; v += 2 ; break ; case 'S' : av . visit ( name , ( short ) readInt ( items [ readUnsignedShort ( v ) ] ) ) ; v += 2 ; break ; case 'C' : av . visit ( name , ( char ) readInt ( items [ readUnsignedShort ( v ) ] ) ) ; v += 2 ; break ; case 's' : av . visit ( name , readUTF8 ( v , buf ) ) ; v += 2 ; break ; case 'e' : av . visitEnum ( name , readUTF8 ( v , buf ) , readUTF8 ( v + 2 , buf ) ) ; v += 4 ; break ; case 'c' : av . visit ( name , Type . getType ( readUTF8 ( v , buf ) ) ) ; v += 2 ; break ; case '@' : v = readAnnotationValues ( v + 2 , buf , true , av . visitAnnotation ( name , readUTF8 ( v , buf ) ) ) ; break ; case '[' : int size = readUnsignedShort ( v ) ; v += 2 ; if ( size == 0 ) { return readAnnotationValues ( v - 2 , buf , false , av . visitArray ( name ) ) ; } switch ( this . b [ v ++ ] & 0xFF ) { case 'B' : byte [ ] bv = new byte [ size ] ; for ( i = 0 ; i < size ; i ++ ) { bv [ i ] = ( byte ) readInt ( items [ readUnsignedShort ( v ) ] ) ; v += 3 ; } av . visit ( name , bv ) ; -- v ; break ; case 'Z' : boolean [ ] zv = new boolean [ size ] ; for ( i = 0 ; i < size ; i ++ ) { zv [ i ] = readInt ( items [ readUnsignedShort ( v ) ] ) != 0 ; v += 3 ; } av . visit ( name , zv ) ; -- v ; break ; case 'S' : short [ ] sv = new short [ size ] ; for ( i = 0 ; i < size ; i ++ ) { sv [ i ] = ( short ) readInt ( items [ readUnsignedShort ( v ) ] ) ; v += 3 ; } av . visit ( name , sv ) ; -- v ; break ; case 'C' : char [ ] cv = new char [ size ] ; for ( i = 0 ; i < size ; i ++ ) { cv [ i ] = ( char ) readInt ( items [ readUnsignedShort ( v ) ] ) ; v += 3 ; } av . visit ( name , cv ) ; -- v ; break ; case 'I' : int [ ] iv = new int [ size ] ; for ( i = 0 ; i < size ; i ++ ) { iv [ i ] = readInt ( items [ readUnsignedShort ( v ) ] ) ; v += 3 ; } av . visit ( name , iv ) ; -- v ; break ; case 'J' : long [ ] lv = new long [ size ] ; for ( i = 0 ; i < size ; i ++ ) { lv [ i ] = readLong ( items [ readUnsignedShort ( v ) ] ) ; v += 3 ; } av . visit ( name , lv ) ; -- v ; break ; case 'F' : float [ ] fv = new float [ size ] ; for ( i = 0 ; i < size ; i ++ ) { fv [ i ] = Float . intBitsToFloat ( readInt ( items [ readUnsignedShort ( v ) ] ) ) ; v += 3 ; } av . visit ( name , fv ) ; -- v ; break ; case 'D' : double [ ] dv = new double [ size ] ; for ( i = 0 ; i < size ; i ++ ) { dv [ i ] = Double . longBitsToDouble ( readLong ( items [ readUnsignedShort ( v ) ] ) ) ; v += 3 ; } av . visit ( name , dv ) ; -- v ; break ; default : v = readAnnotationValues ( v - 3 , buf , false , av . visitArray ( name ) ) ; } } return v ; }
reads a value of an annotation and makes the given visitor visit it .
