public static TypeDescriptor fromRaw()

in core/src/main/java/com/spotify/missinglink/datamodel/TypeDescriptors.java [58:81]


  public static TypeDescriptor fromRaw(String raw) {
    final int length = raw.length();

    int dimensions = raw.lastIndexOf('[') + 1;

    final String subType = raw.substring(dimensions);

    final TypeDescriptor simpleType;
    if (subType.equals("V")) {
      simpleType = VoidTypeDescriptor.voidTypeDescriptor;
    } else if (subType.startsWith("L") && subType.endsWith(";")) {
      simpleType = fromClassName(subType.substring(1, length - dimensions - 1));
    } else {
      simpleType = PrimitiveTypeDescriptor.fromRaw(subType);
      if (simpleType == null) {
        throw new InputMismatchException("Invalid type descriptor: " + raw);
      }
    }

    if (dimensions > 0) {
      return new ArrayTypeDescriptor(simpleType, dimensions);
    }
    return simpleType;
  }