예제 #1
0
 static String parameterizedTypeToString(DocEnv env, ClassType cl, boolean full) {
   if (env.legacyDoclet) {
     return TypeMaker.getTypeName(cl, full);
   }
   StringBuffer s = new StringBuffer();
   if (cl.getEnclosingType().tag != CLASS) { // if not an inner class...
     s.append(TypeMaker.getTypeName(cl, full));
   } else {
     ClassType encl = (ClassType) cl.getEnclosingType();
     s.append(parameterizedTypeToString(env, encl, full))
         .append('.')
         .append(cl.tsym.name.toString());
   }
   s.append(TypeMaker.typeArgumentsString(env, cl, full));
   return s.toString();
 }
예제 #2
0
 @Override
 public String visitClassType(ClassType t, Locale locale) {
   StringBuilder buf = new StringBuilder();
   if (t.getEnclosingType().tag == CLASS && t.tsym.owner.kind == Kinds.TYP) {
     buf.append(visit(t.getEnclosingType(), locale));
     buf.append('.');
     buf.append(className(t, false, locale));
   } else {
     buf.append(className(t, true, locale));
   }
   if (t.getTypeArguments().nonEmpty()) {
     buf.append('<');
     buf.append(visitTypes(t.getTypeArguments(), locale));
     buf.append('>');
   }
   return buf.toString();
 }
예제 #3
0
 public Void visitClassType(ClassType type, Void ignore) {
   printType("outer", type.getEnclosingType(), Details.SUMMARY);
   printList("typarams", type.typarams_field);
   printList("allparams", type.allparams_field);
   printType("supertype", type.supertype_field, Details.SUMMARY);
   printList("interfaces", type.interfaces_field);
   printList("allinterfaces", type.all_interfaces_field);
   return visitType(type, null);
 }
 @Override
 public Void visitClassType(ClassType t, Void ignored) {
   if (t.isCompound()) {
     if (indexOf(t, WhereClauseKind.INTERSECTION) == -1) {
       Type supertype = types.supertype(t);
       List<Type> interfaces = types.interfaces(t);
       JCDiagnostic d =
           diags.fragment("where.intersection", t, interfaces.prepend(supertype));
       whereClauses.get(WhereClauseKind.INTERSECTION).put(t, d);
       visit(supertype);
       visit(interfaces);
     }
   }
   nameSimplifier.addUsage(t.tsym);
   visit(t.getTypeArguments());
   if (t.getEnclosingType() != Type.noType) visit(t.getEnclosingType());
   return null;
 }