Interface HTMLCleanerConfiguration


  • public interface HTMLCleanerConfiguration
    Represents a configuration for the HTMLCleaner and allows to configure the cleaning parameters and cleaning filters to apply.
    Since:
    1.8.1
    Version:
    $Id: 3fa4139333acae839964fc121aa95a7f24fbd706 $
    • Field Detail

      • NAMESPACES_AWARE

        static final String NAMESPACES_AWARE
        Cleaning property identifier which decides if parsing should omit/keep namespace information.
        See Also:
        Constant Field Values
      • RESTRICTED

        static final String RESTRICTED
        Cleaning in restricted mode (<script> and <style> should not be allowed for example).
        See Also:
        Constant Field Values
      • USE_CHARACTER_REFERENCES

        static final String USE_CHARACTER_REFERENCES
        Cleaning property that controls whether the output HTML should use character references rather than entity references. This is useful if you need to parse the clean HTML as XML later.
        See Also:
        Constant Field Values
      • TRANSLATE_SPECIAL_ENTITIES

        static final String TRANSLATE_SPECIAL_ENTITIES
        Cleaning property that transform special HTML entities to be recognized by an XML parser.
        Since:
        12.3RC1
        See Also:
        Constant Field Values
      • HTML_VERSION

        @Unstable
        static final String HTML_VERSION
        The HTML (major) version. Should be "5" for HTML5 and "4" (default) otherwise for the default implementation.
        Since:
        14.0RC1
        See Also:
        Constant Field Values
    • Method Detail

      • getFilters

        List<HTMLFilter> getFilters()
        Returns:
        the ordered list of filters to use for cleaning the HTML content
      • setFilters

        void setFilters​(List<HTMLFilter> filters)
        Parameters:
        filters - the ordered list of filters to use for cleaning the HTML content
      • getParameters

        Map<String,​String> getParameters()
        Returns:
        the list of cleaning parameters that will be used to clean the HTML content. Note that these parameters are implementation dependent and thus depend on the HTML cleaner implementation used.
      • setParameters

        void setParameters​(Map<String,​String> cleaningParameters)
        Parameters:
        cleaningParameters - the list of cleaning parameters that will be used to clean the HTML content