in apache-rat-tools/src/main/java/org/apache/rat/tools/AntDocumentation.java [115:147]
private void printOptions(final Writer out, final List<AntOption> options,
final Predicate<AntOption> typeFilter, final String tableCaption) throws IOException {
boolean hasDeprecated = options.stream().anyMatch(typeFilter.and(AntOption::isDeprecated));
if (hasDeprecated) {
AptFormat.writeHeader(out, 2, "Current");
}
List<List<String>> table = new ArrayList<>();
table.add(Arrays.asList("Name", "Description", "Value Type", "Required"));
options.stream().filter(typeFilter.and(o -> !o.isDeprecated()))
.map(o -> Arrays.asList(o.getName(), o.getDescription(),
o.hasArg() ? StringUtils.defaultIfEmpty(o.getArgName(), "String") : "boolean",
o.isRequired() ? "true" : "false"))
.forEach(table::add);
AptFormat.writeTable(out, table, "*--+--+--+--+", tableCaption);
if (hasDeprecated) {
AptFormat.writeHeader(out, 2, "Deprecated ");
table.clear();
table.add(Arrays.asList("Name", "Description", "Argument Type", "Deprecated"));
options.stream().filter(typeFilter.and(AntOption::isDeprecated))
.map(o -> Arrays.asList(o.getName(), o.getDescription(),
o.hasArg() ? StringUtils.defaultIfEmpty(o.getArgName(), "String") : "boolean",
o.getDeprecated()))
.forEach(table::add);
AptFormat.writeTable(out, table, "*--+--+--+--+", tableCaption);
}
}