@Override public String apply(Comment input) { return input.getValue(); } }).toList();
private void printComments(List<Comment> comments, String indent) { for (Comment comment : comments) { out.println(indent + comment.getValue()); } }
public CommentDTO(Comment comment) { this.value = comment.getValue(); this.line = comment.getLine(); }
public StringBuilder addComment(StringBuilder sb, Comment comment) { createLine(sb, comment.getLine(), RESULT_TYPE.NO_RESULT); sb.append("<span style=\"font-style:italic; color: #666666\">"); sb.append(comment.getValue()); sb.append("</span>"); endLine(sb); return sb; }
@Override public void step(Step step) { if (lineOffset != 0 && isPreview) { int newLine = step.getLine().intValue() + lineOffset.intValue(); featureLineOffset.put(step.getLine().intValue(), newLine); step = new Step(step.getComments(), step.getKeyword(), step.getName(), newLine, step.getRows(), step.getDocString()); } if (step.getRows() != null && step.getRows().get(0) != null && !step.getRows().get(0).getComments().isEmpty()) { String filePathFromComment = getExtractFilePathFromComment(step.getRows().get(0).getComments().get(0).getValue()); Resource sourceResource = getSourceResource(filePathFromComment); if (sourceResource != null) { step = loadAndReplaceSteps(step, filePathFromComment, sourceResource); } } super.step(step); prettyFormatter.step(step); }
buffer.append(comment.getValue()); buffer.append("\n"); rowHeight++;
@Override public void examples(Examples examples) { ExamplesTableRow cells = examples.getRows().isEmpty() ? null : examples.getRows().get(0); if (cells != null && lineOffset != 0 && isPreview && cells.getComments().isEmpty()) { int newLine = cells.getLine() + lineOffset.intValue(); featureLineOffset.put(cells.getLine(), newLine); List<ExamplesTableRow> rows = examples.getRows(); List<ExamplesTableRow> newRows = new ArrayList<ExamplesTableRow>(); for (ExamplesTableRow examplesTableRow : rows) { featureLineOffset.put(examplesTableRow.getLine(), examplesTableRow.getLine() + lineOffset); ExamplesTableRow tableRow = new ExamplesTableRow(examplesTableRow.getComments(), examplesTableRow.getCells(), examplesTableRow.getLine() + lineOffset, examplesTableRow.getId()); newRows.add(tableRow); } examples.setRows(newRows); } if (cells != null && !cells.getComments().isEmpty()) { String filePathFromComment = getExtractFilePathFromComment(cells.getComments().get(0).getValue()); Resource sourceResource = getSourceResource(filePathFromComment); if (sourceResource != null) { loadAndReplaceExamples(examples, cells, filePathFromComment, sourceResource); } } super.examples(examples); prettyFormatter.examples(examples); }