public static void describeClass(CtClass c) throws ClassNotFoundException, NotFoundException {
      StringBuilder bb = new StringBuilder();

      bb.append("name: ").append(c.getName()).append("\n");
      bb.append("annotations: ");
      Object[] ann = c.getAnnotations();
      if (ann.length == 0) {
         bb.append("none\n");
      } else {
         for (Object o: ann) {
            bb.append(o.toString()).append(",");
         }
         bb.append("\n");
      }

      bb.append("fields: ");
      CtField[] flds = c.getFields();
      if (flds.length == 0) {
         bb.append("none\n");
      } else {
         for (CtField f: flds) {
            bb.append(f.getName()).append("(").append(f.getType().getName()).append(")");
         }
         bb.append("\n");
      }

      bb.append("methods: ");
      CtMethod[] mthds = c.getMethods();
      if (mthds.length == 0) {
         bb.append("none\n");
      } else {
         bb.append("\n");
         for (CtMethod m: mthds) {
            if (m.getDeclaringClass() == c) {
               bb.append("   ");
               bb.append(m.getReturnType().getSimpleName()).append(" ");
               bb.append(m.getName()).append("(");
               for (CtClass p: m.getParameterTypes()) {
                  bb.append(p.getSimpleName()).append(",");
               }
               bb.append(")\n");
            }
         }
      }

      System.out.println(bb.toString());
   }