javap/src/main/java/org/apidesign/javap/AnnotationParser.java
branchreflection
changeset 659 7c0eb1a5d0b8
parent 655 044c72732424
     1.1 --- a/javap/src/main/java/org/apidesign/javap/AnnotationParser.java	Sun Feb 03 23:18:47 2013 +0100
     1.2 +++ b/javap/src/main/java/org/apidesign/javap/AnnotationParser.java	Mon Feb 04 22:03:49 2013 +0100
     1.3 @@ -42,10 +42,10 @@
     1.4          this.iterateArray = iterateArray;
     1.5      }
     1.6  
     1.7 -    protected void visitAnnotationStart(String type) throws IOException {
     1.8 +    protected void visitAnnotationStart(String type, boolean top) throws IOException {
     1.9      }
    1.10  
    1.11 -    protected void visitAnnotationEnd(String type) throws IOException {
    1.12 +    protected void visitAnnotationEnd(String type, boolean top) throws IOException {
    1.13      }
    1.14  
    1.15      protected void visitValueStart(String attrName, char type) throws IOException {
    1.16 @@ -85,20 +85,20 @@
    1.17      private void read(DataInputStream dis, ClassData cd) throws IOException {
    1.18      	int cnt = dis.readUnsignedShort();
    1.19          for (int i = 0; i < cnt; i++) {
    1.20 -            readAnno(dis, cd);
    1.21 +            readAnno(dis, cd, true);
    1.22          }
    1.23      }
    1.24  
    1.25 -    private void readAnno(DataInputStream dis, ClassData cd) throws IOException {
    1.26 +    private void readAnno(DataInputStream dis, ClassData cd, boolean top) throws IOException {
    1.27          int type = dis.readUnsignedShort();
    1.28          String typeName = cd.StringValue(type);
    1.29 -        visitAnnotationStart(typeName);
    1.30 +        visitAnnotationStart(typeName, top);
    1.31      	int cnt = dis.readUnsignedShort();
    1.32      	for (int i = 0; i < cnt; i++) {
    1.33              String attrName = cd.StringValue(dis.readUnsignedShort());
    1.34              readValue(dis, cd, typeName, attrName);
    1.35          }
    1.36 -        visitAnnotationEnd(typeName);
    1.37 +        visitAnnotationEnd(typeName, top);
    1.38          if (cnt == 0) {
    1.39              visitAttr(typeName, null, null, null);
    1.40          }
    1.41 @@ -110,7 +110,7 @@
    1.42          char type = (char)dis.readByte();
    1.43          visitValueStart(attrName, type);
    1.44          if (type == '@') {
    1.45 -            readAnno(dis, cd);
    1.46 +            readAnno(dis, cd, false);
    1.47          } else if ("CFJZsSIDB".indexOf(type) >= 0) { // NOI18N
    1.48              int primitive = dis.readUnsignedShort();
    1.49              String val = cd.stringValue(primitive, textual);