Exemplo n.º 1
0
  protected void store(OptionsHandler formatter) throws IOException {
    formatter.startOptions();
    storeComment(formatter, _headerComment);

    for (String name : keySet()) {
      int c = getNewLineCount(name);
      if (getConfig().isEmptyLines() && c > 0) {
        for (int i = 0; i < c; i++) {
          formatter.handleEmptyLine();
        }
      }

      storeComment(formatter, getComment(name));
      int n = getConfig().isMultiOption() || getConfig().isAutoNumbering() ? length(name) : 1;

      for (int i = 0; i < n; i++) {
        String value = get(name, i);

        if (getConfig().isAutoNumbering() && name.endsWith(".")) {
          if (value != null) {
            formatter.handleOption(name + i, value);
          }
        } else {
          formatter.handleOption(name, value);
        }
      }
    }
    if (_footerComment != null) {
      formatter.handleEmptyLine();
      storeComment(formatter, _footerComment);
    }

    formatter.endOptions();
  }
Exemplo n.º 2
0
 private void storeComment(OptionsHandler formatter, List<String> comment) {
   formatter.handleComment(comment);
 }