Ejemplo n.º 1
0
    public void log(Logging log, Level level, boolean includeHeader) {
      if (Logging.wouldLog(log, level)) {
        val files = compilationUnits.getCompilationUnitsStartWith(Arrays.asList(""));
        val fileSets =
            new HashMap<CodeFileSrc<CodeLanguage>, List<ClassAst.SimpleImpl<BlockType>>>();
        for (val file : files) {
          List<ClassAst.SimpleImpl<BlockType>> fileSet = fileSets.get(file.getId());
          if (fileSet == null) {
            fileSet = new ArrayList<>();
            fileSets.put(file.getId(), fileSet);
          }
          fileSet.add(file.getParsedClass());
        }

        val sb = new StringBuilder();
        if (includeHeader) {
          sb.append(newline);
          sb.append("Classes/interfaces by file:");
          sb.append(newline);
        }
        for (val fileSet : fileSets.entrySet()) {
          JsonStringify.inst
              .propName(fileSet.getKey().getSrcName(), sb)
              .toArray(
                  fileSet.getValue(),
                  sb,
                  (f) -> NameUtil.joinFqName(f.getSignature().getFullName()))
              .append(newline, sb);
        }

        log.log(level, this.getClass(), sb.toString());
      }
    }
Ejemplo n.º 2
0
    public void log(Logging log, Level level, boolean includeHeader) {
      if (Logging.wouldLog(log, level)) {
        val sb = new StringBuilder();
        if (includeHeader) {
          sb.append(newline);
          sb.append("destination sets:");
          sb.append(newline);
        }

        for (val entry : filterSets.entrySet()) {
          sb.append(newline);
          sb.append(entry.getKey());
          sb.append(newline);
          JsonStringify.inst.join(
              entry.getValue(),
              newline,
              false,
              sb,
              (f) -> NameUtil.joinFqName(f.getParsedClass().getSignature().getFullName()));
          sb.append(newline);
        }
        log.log(level, this.getClass(), sb.toString());
      }
    }