-
- public String toString() { StringBuffer sb = new StringBuffer(); toString(sb); return sb.toString(); }
- public void toString(StringBuffer sb) {
- sb.append(flagsToString(flags));
- sb.append((flags & ACC_INTERFACE) != 0 ? "interface " : "class ");
- sb.append(thisType);
- if (superType != null) sb.append(" extends " + superType);
+
+ public Type.Class.Field.Body[] fields() {
+ Type.Class.Field.Body[] ret = new Type.Class.Field.Body[fields.size()];
+ fields.copyInto(ret);
+ return ret;
+ }
+
+ static String flagsToString(int flags, boolean isClass) {
+ StringBuffer sb = new StringBuffer(32);
+ if ((flags & PUBLIC) != 0) sb.append("public ");
+ if ((flags & PRIVATE) != 0) sb.append("private ");
+ if ((flags & PROTECTED) != 0) sb.append("protected ");
+ if ((flags & STATIC) != 0) sb.append("static ");
+ if ((flags & FINAL) != 0) sb.append("final ");
+ if ((flags & ABSTRACT) != 0) sb.append("abstract ");
+ if (!isClass && (flags & SYNCHRONIZED) != 0) sb.append("synchronized ");
+ if (!isClass && (flags & NATIVE) != 0) sb.append("native ");
+ if (!isClass && (flags & STRICT) != 0) sb.append("strictfp ");
+ if (!isClass && (flags & VOLATILE) != 0) sb.append("volatile ");
+ if (!isClass && (flags & TRANSIENT) != 0) sb.append("transient ");
+ return sb.toString();
+ }
+
+ public Type.Class getType() { return thisType; }
+ public int getFlags() { return flags; }
+
+ public String toString() { return toString(new StringBuffer(4096)).toString(); }
+ StringBuffer toString(StringBuffer sb) {
+ sb.append(flagsToString(flags,true));
+ sb.append((flags & INTERFACE) != 0 ? "interface " : "class ");
+ sb.append(thisType.toString());
+ if (superType != null) sb.append(" extends " + superType.toString());