public void characters()

in freemarker-docgen-core/src/main/java/org/freemarker/docgen/core/DocgenRestrictionsValidator.java [464:501]


    public void characters(char[] ch, int start, int length)
            throws SAXException {
        if (invisibleElementNestingLevel == 0
                && programlistingNestingLevel > 0) {
            int end = start + length;
            for (int i = start; i < end; i++) {
                char c = ch[i];
                if (c == 0x0A || c == 0x0D) {
                    programlistingLineLength = 0;
                } else {
                    if (c == 0x09) {
                        // Assuming tab-width 8:
                        programlistingLineLength
                                = ((programlistingLineLength / 8) + 1) * 8;
                        errorHandler.error(newSAXException(
                                "Tab character is not allowed in "
                                + "programlistings. (Hint: Use spaces instead.)"
                                ));
                    } else {
                        programlistingLineLength++;
                    }
                }
                if (programlistingLineLength
                        == options.getMaximumProgramlistingWidth() + 1) {
                    errorHandler.error(newSAXException(
                            "Line length in the programlisting exceeded "
                            + options.getMaximumProgramlistingWidth()
                            + ", which was set as the maximum in the "
                            + "(Related Docgen setting: \""
                            + Transform.SETTING_VALIDATION + "\" per \""
                            + Transform
                                .SETTING_VALIDATION_MAXIMUM_PROGRAMLISTING_WIDTH
                            + "\")"));
                }
            }
        }
        docbook5Validator.characters(ch, start, length);
    }