docs: private String replaceOptionals(String contents) {
          if (!replaceOptionals) {
              return contents;
          }
          try {
              final Pattern pattern = Pattern.compile("@\\{(.[^}]*)\\}");
              final Collection<String> columns = getColumnNames();
              columns.add("row.rowNumber");
              final BufferedReader reader = new BufferedReader(new StringReader(
                      contents));
              String line = null;
              final StringBuffer newLine = new StringBuffer();
              while ((line = reader.readLine()) != null) {
                  final Matcher matcher = pattern.matcher(line);
                  int optCols = 0;
                  while (matcher.find()) {
                      final String c = matcher.group(1);
                      if (!columns.contains(c)) {
                          newLine.append("@if{").append(matcher.group(1)).append(
                                  " != null}");
                          optCols++;
                      }
                  }
                  newLine.append(line);
                  newLine.append(StringUtils.repeat("@end{}", optCols));
                  newLine.append("\n");
              }
              //            logger.info("newLine: " + newLine);
              return newLine.toString();
  
          } catch (IOException e) {
              throw new RuntimeException(e);
          }
      }