1.1 --- a/javap/src/main/java/org/apidesign/javap/AnnotationParser.java Sun Dec 02 12:39:51 2012 +0100
1.2 +++ b/javap/src/main/java/org/apidesign/javap/AnnotationParser.java Sun Dec 02 14:01:17 2012 +0100
1.3 @@ -34,7 +34,10 @@
1.4 * @author Jaroslav Tulach <jtulach@netbeans.org>
1.5 */
1.6 public class AnnotationParser {
1.7 - protected AnnotationParser() {
1.8 + private final boolean textual;
1.9 +
1.10 + protected AnnotationParser(boolean textual) {
1.11 + this.textual = textual;
1.12 }
1.13
1.14 protected void visitAnnotationStart(String type) throws IOException {
1.15 @@ -90,13 +93,17 @@
1.16 readAnno(dis, cd);
1.17 } else if ("CFJZsSIDB".indexOf(type) >= 0) { // NOI18N
1.18 int primitive = dis.readUnsignedShort();
1.19 + String val = cd.stringValue(primitive, textual);
1.20 String attrType;
1.21 if (type == 's') {
1.22 attrType = "Ljava_lang_String";
1.23 + if (textual) {
1.24 + val = '"' + val + '"';
1.25 + }
1.26 } else {
1.27 attrType = "" + type;
1.28 }
1.29 - visitAttr(typeName, attrName, attrType, cd.StringValue(primitive));
1.30 + visitAttr(typeName, attrName, attrType, val);
1.31 } else if (type == 'c') {
1.32 int cls = dis.readUnsignedShort();
1.33 } else if (type == '[') {