403
404 /**
405 * Return the qualified name and any type parameters.
406 * Each parameter is a type variable with optional bounds.
407 */
408 @Override
409 public String toString() {
410 return classToString(env, tsym, true);
411 }
412
413 /**
414 * Return the class name as a string. If "full" is true the name is
415 * qualified, otherwise it is qualified by its enclosing class(es) only.
416 */
417 static String getClassName(ClassSymbol c, boolean full) {
418 if (full) {
419 return c.getQualifiedName().toString();
420 } else {
421 String n = "";
422 for ( ; c != null; c = c.owner.enclClass()) {
423 n = c.name + (n.equals("") ? "" : ".") + n;
424 }
425 return n;
426 }
427 }
428
429 /**
430 * Return the class name with any type parameters as a string.
431 * Each parameter is a type variable with optional bounds.
432 * If "full" is true all names are qualified, otherwise they are
433 * qualified by their enclosing class(es) only.
434 */
435 static String classToString(DocEnv env, ClassSymbol c, boolean full) {
436 StringBuilder s = new StringBuilder();
437 if (!c.isInner()) { // if c is not an inner class
438 s.append(getClassName(c, full));
439 } else {
440 // c is an inner class, so include type params of outer.
441 ClassSymbol encl = c.owner.enclClass();
442 s.append(classToString(env, encl, full))
443 .append('.')
|
403
404 /**
405 * Return the qualified name and any type parameters.
406 * Each parameter is a type variable with optional bounds.
407 */
408 @Override
409 public String toString() {
410 return classToString(env, tsym, true);
411 }
412
413 /**
414 * Return the class name as a string. If "full" is true the name is
415 * qualified, otherwise it is qualified by its enclosing class(es) only.
416 */
417 static String getClassName(ClassSymbol c, boolean full) {
418 if (full) {
419 return c.getQualifiedName().toString();
420 } else {
421 String n = "";
422 for ( ; c != null; c = c.owner.enclClass()) {
423 n = c.name + (n.isEmpty() ? "" : ".") + n;
424 }
425 return n;
426 }
427 }
428
429 /**
430 * Return the class name with any type parameters as a string.
431 * Each parameter is a type variable with optional bounds.
432 * If "full" is true all names are qualified, otherwise they are
433 * qualified by their enclosing class(es) only.
434 */
435 static String classToString(DocEnv env, ClassSymbol c, boolean full) {
436 StringBuilder s = new StringBuilder();
437 if (!c.isInner()) { // if c is not an inner class
438 s.append(getClassName(c, full));
439 } else {
440 // c is an inner class, so include type params of outer.
441 ClassSymbol encl = c.owner.enclClass();
442 s.append(classToString(env, encl, full))
443 .append('.')
|