Esempio n. 1
0
  @Override
  @NotNull
  public ClassId getClassId(int index) {
    LinkedList<String> packageFqName = new LinkedList<String>();
    LinkedList<String> relativeClassName = new LinkedList<String>();
    boolean local = false;

    while (index != -1) {
      QualifiedName proto = qualifiedNames.getQualifiedName(index);
      String shortName = strings.getString(proto.getShortName());
      switch (proto.getKind()) {
        case CLASS:
          relativeClassName.addFirst(shortName);
          break;
        case PACKAGE:
          packageFqName.addFirst(shortName);
          break;
        case LOCAL:
          relativeClassName.addFirst(shortName);
          local = true;
          break;
      }

      index = proto.getParentQualifiedName();
    }

    return new ClassId(
        FqName.fromSegments(packageFqName), FqName.fromSegments(relativeClassName), local);
  }
Esempio n. 2
0
 @NotNull
 public static NameResolverImpl read(@NotNull InputStream in) {
   try {
     ProtoBuf.StringTable simpleNames = ProtoBuf.StringTable.parseDelimitedFrom(in);
     ProtoBuf.QualifiedNameTable qualifiedNames =
         ProtoBuf.QualifiedNameTable.parseDelimitedFrom(in);
     return new NameResolverImpl(simpleNames, qualifiedNames);
   } catch (IOException e) {
     throw ExceptionUtilsKt.rethrow(e);
   }
 }
Esempio n. 3
0
 @Override
 @NotNull
 public Name getName(int index) {
   return Name.guess(strings.getString(index));
 }
Esempio n. 4
0
 @Override
 @NotNull
 public String getString(int index) {
   return strings.getString(index);
 }