Class XmlCleaningResponseFilter

    • Method Detail

      • filter

        public AppendingStringBuffer filter​(AppendingStringBuffer responseBuffer)
        Description copied from interface: IResponseFilter
        Filters the response buffer and returns the filtered response that can be used in the next filter or returned to the real output itself. A filter may alter the response buffer and return the response buffer itself.
        Specified by:
        filter in interface IResponseFilter
        responseBuffer - The response buffer to be filtered
        The changed buffer or the response buffer itself (changed or not)
      • shouldFilter

        protected boolean shouldFilter​(AppendingStringBuffer responseBuffer)
        Decides whether the filter should be applied.
        responseBuffer - The buffer to filter
        true if the buffer brings Ajax response
      • stripNonValidXMLCharacters

        public AppendingStringBuffer stripNonValidXMLCharacters​(AppendingStringBuffer input)
        This method ensures that the output String has only valid XML unicode characters as specified by the XML 1.0 standard. For reference, please see the standard. This method will return an empty String if the input is null or empty.
        input - The StringBuffer whose non-valid characters we want to remove.
        The in String, stripped of non-valid characters.
      • isValidXmlChar

        protected boolean isValidXmlChar​(int codePoint)
        Checks whether the character represented by this codePoint is a valid in XML documents.
        codePoint - The codePoint for the checked character
        true if the character can be used in XML documents