Пример #1
0
  public String toString() {
    Name name = name();

    if (kind() == null) {
      return "<unknown class " + name + typeParameterString() + ">";
    }

    if (kind() == ANONYMOUS) {
      if (interfaces != null && !interfaces.isEmpty()) {
        return isFunction()
            ? "" + interfaces.get(0)
            : "<anonymous subtype of " + interfaces.get(0) + typeParameters() + ">";
      }
      if (superType != null) {
        return "<anonymous subclass of " + superType + ">" + typeParameterString();
      }
    }

    if (kind() == TOP_LEVEL) {
      Package p = Types.get(package_());
      return (p != null ? p.toString() + "." : "") + name + typeParameterString();
    } else if (kind() == MEMBER) {
      ClassDef outer = Types.get(outer());
      return (outer != null ? outer.toString() + "." : "") + name + typeParameterString();
    } else {
      return name.toString() + typeParameterString();
    }
  }
Пример #2
0
 public String toString() {
   return name.toString(); //  + "@" + index;
 }