void setTextMode(TextMode mode) {
    if (this.mode[depth] == mode) {
      return;
    }
    this.mode[depth] = mode;
    if (mode == TextMode.PRESERVE) {
      levelEOL[depth] = null;
      levelIndent[depth] = null;
      levelEOLIndent[depth] = null;
      termEOLIndent[depth] = null;
    }
    else {
      levelEOL[depth] = lineSeparator;
      if (indent == null || lineSeparator == null) {
        levelEOLIndent[depth] = null;
        termEOLIndent[depth] = null;
      }
      else {
        if (depth > 0) {
          final StringBuilder sb = new StringBuilder(indent.length() * depth);
          for (int i = 1; i < depth; i++) {
            sb.append(indent);
          }
          // the start point was '1', so we are one indent
          // short, which is just right for the term....
          termEOLIndent[depth] = lineSeparator + sb;
          // but we increase it once for the actual indent.
          sb.append(indent);
          levelIndent[depth] = sb.toString();
        }
        else {
          termEOLIndent[depth] = lineSeparator;
          levelIndent[depth] = "";
        }
        levelEOLIndent[depth] = lineSeparator + levelIndent[depth];
      }
    }
    resetReusableIndents();
  }
void setTextMode(TextMode mode)