Add indentation for the current level.

@exception org.xml.sax.SAXException If a filter
further down the chain raises an exception.
979499
private void doIndent ()
    throws SAXException
    {
        int n = indentStep * stateStack.size();
        if (n > 0) {
            char ch[] = new char[n];
            for (int i = 0; i < n; i++) {
                ch[i] = INDENT_CHAR;
            }
            super.characters(ch, 0, n);
        }
    }
400666
private void appendDetailedString(int level, StringBuilder stringBuilder) {
    String pad = Strings.repeat("--", level);
    stringBuilder.append(pad).append(this).append(SystemUtils.LINE_SEPARATOR);
    for (ProductPartitionNode childNode : getChildren()) {
      childNode.appendDetailedString(level + 1, stringBuilder);
    }
  }
943075
private void setIndentation(int length, boolean open) {

        if (open) {
            m_indent += length;
        } else {
            m_indent -= length;
            if (m_indent < 0) {
                m_indent = 0;
            }
        }
    }
787770
private int insertIndex(List<BeanMetadataElement> filterChain) {
    int i;
    for (i = 0; i < filterChain.size(); i++) {
      BeanMetadataElement filter = filterChain.get(i);
      if (filter instanceof BeanDefinition) {
        String beanName = ((BeanDefinition) filter).getBeanClassName();
        if (beanName.equals(ExceptionTranslationFilter.class.getName())) {
           return i + 1;
        }
      }
    }
    return filterChain.size();
  }
1303032
private void appendInlineEvent(Event event) throws SAXException
    {
        cleanContentLeadingSpaces();
        cleanContentExtraWhiteSpaces();

        if (getContent().length() > 0) {
            sendPreviousContent(false);

            fPreviousInlineText.append(getContent());

            if (getContent().charAt(getContent().length() - 1) == ' ') {
                fPreviousContent = getContent().toString();
                fPreviousElements.add(event);
            } else {
                sendCharacters(getContent().toString().toCharArray());
                sendInlineEvent(event);
            }

            getContent().setLength(0);
        } else {
            if (fPreviousInlineText.length() == 0) {
                // There is no inline text before this inline element
                sendInlineEvent(event);
            } else {
                // The last inline text ends with a space
                fPreviousElements.add(event);
            }
        }
    }
109061
public void addFilter(AbstractLogFilter<E> filter) {
                Validate.notNull(filter);
                filters.add(filter);
                uptodate = false;
                filter.addObserver(this);
        }
1280780
private static void expandRules() {

    // long start = System.currentTimeMillis();

    // iterate over all SAX containers
    // ArrayList<SAXMapEntry<Integer, Integer>> recs = new ArrayList<SAXMapEntry<Integer, Integer>>(
    // arrRuleRecords.size());
    //
    // for (GrammarRuleRecord ruleRecord : arrRuleRecords) {
    // recs.add(new SAXMapEntry<Integer, Integer>(ruleRecord.getRuleLevel(), ruleRecord
    // .getRuleNumber()));
    // }
    //
    // Collections.sort(recs, new Comparator<SAXMapEntry<Integer, Integer>>() {
    // @Override
    // public int compare(SAXMapEntry<Integer, Integer> o1, SAXMapEntry<Integer, Integer> o2) {
    // return o1.getKey().compareTo(o2.getKey());
    // }
    // });

    // for (SAXMapEntry<Integer, Integer> entry : recs) {
    for (GrammarRuleRecord ruleRecord : arrRuleRecords) {

      if (ruleRecord.getRuleNumber() == 0) {
        continue;
      }

      String curString = ruleRecord.getRuleString();
      StringBuilder resultString = new StringBuilder(8192);

      String[] split = curString.split(" ");

      for (String s : split) {
        if (s.startsWith("R")) {
          resultString.append(" ").append(expandRule(Integer.valueOf(s.substring(1, s.length()))));
        }
        else {
          resultString.append(" ").append(s);
        }
      }

      // need to trim space at the very end
      String rr = resultString.delete(0, 1).append(" ").toString();
      ruleRecord.setExpandedRuleString(rr);
      ruleRecord.setRuleYield(countSpaces(rr));
    }

    StringBuilder resultString = new StringBuilder(8192);

    GrammarRuleRecord ruleRecord = arrRuleRecords.get(0);
    resultString.append(ruleRecord.getRuleString());

    int currentSearchStart = resultString.indexOf("R");
    while (currentSearchStart >= 0) {
      int spaceIdx = resultString.indexOf(" ", currentSearchStart);
      String ruleName = resultString.substring(currentSearchStart, spaceIdx + 1);
      Integer ruleId = Integer.valueOf(ruleName.substring(1, ruleName.length() - 1));
      resultString.replace(spaceIdx - ruleName.length() + 1, spaceIdx + 1,
          arrRuleRecords.get(ruleId).getExpandedRuleString());
      currentSearchStart = resultString.indexOf("R");
    }
    ruleRecord.setExpandedRuleString(resultString.toString().trim());
    // ruleRecord.setRuleYield(countSpaces(resultString));

    // long end = System.currentTimeMillis();
    // System.out.println("Rules expanded in " + SAXFactory.timeToString(start, end));

  }
784631
public static void addEndingSlashIfNeeded(StringBuilder src) {
		if (src == null || StringUtils.isEmptyOrNull(String.valueOf(src))) {
			return;
		}
		if (src != null
				&& src.charAt(src.length() - 1) != File.separator.charAt(0)) {
			src.append(File.separator);
		}
		return;
	}
502892
protected void indent() throws IOException {
        if (prettyPrint) {
            for (int i = 0; i < indentDepth; i++) {
                writer.write(indentString);
            }
        }
    }
1095635
@Override
  void visitEnclosingElement(Tokenizer.Token value) throws IOException {
    printIndents();
    write("<" + value.getEditsElement().toString() + ">\n");
    tagQ.push(value.getEditsElement());
    depthCounter.incLevel();
  }
239281
public void addSubFileFilter()
    {
        // Override this if it is not correct.
        SubFileFilter listener = null;
        this.getMainRecord().setKeyArea(BaseFolder.PARENT_FOLDER_ID_KEY);
        this.getMainRecord().addListener(listener = new SubFileFilter(this.getHeaderRecord()));
        if (this.getMainRecord().getKeyArea().getField(DBConstants.MAIN_KEY_FIELD).isNullable() == false)
        {
            listener.setFilterIfNull(true);
            listener.setAddNewHeaderOnAdd(false);
        }
        // Set it back
        if (DBConstants.TRUE.equalsIgnoreCase(this.getProperty("fakeHeader")))
            this.setProperty(DBParams.HEADER_OBJECT_ID, DBConstants.BLANK);
    }
577554
def _setBlockIndent(self, block, indent):
        
        currentIndent = self._blockIndent(block)
        self._qpart.replaceText((block.blockNumber(), 0), len(currentIndent), indent)
925421
public void setIndent(Integer indent) {
		if (indent == null) {
			remove(OutputKeys.INDENT);
			remove(INDENT_AMT);
			return;
		}

		if (indent < 0) {
			throw Messages.INSTANCE.getIllegalArgumentException(11);
		}

		put(OutputKeys.INDENT, "yes");
		put(INDENT_AMT, indent.toString());
	}
17752
protected void addNestedFormatter(String elementName, CmsXmlContentDefinition contentDefinition)
    throws CmsXmlException {

        if (contentDefinition.getSchemaType(elementName) == null) {
            throw new CmsXmlException(
                Messages.get().container(Messages.ERR_XMLCONTENT_INVALID_ELEM_MAPPING_1, elementName));
        }
        m_nestedFormatterElements.add(elementName);
    }
226063
def add(self, indent, line):
        
        if isinstance(line, str):
            list.append(self, indent*4*' ' + line)
        else:
            for subline in line:
                list.append(self, indent*4*' ' + subline)
592904
def fix_indentation(self, index=None):
        """"""
        if index is None:
            index = self.get_stack_index()
        finfo = self.data[index]
        finfo.editor.fix_indentation()
806505
private void newlineAndIndent(){
        if (isWriting()){
            if (isClosed){
                write(Indentation.tabs(depth)); // \n\t\t\t\...
            } else {
                depth++;
                write(Indentation.closedTabs(depth)); // >\n\t\t\t\...
                isClosed = true;
            }
        }
    }