Class IgnoredHtmlElement


  • public class IgnoredHtmlElement
    extends Object
    Provides a standard class to note which HTML elements should be left in the final output.
    Author:
    Phil DeJarnett
    • Constructor Detail

      • IgnoredHtmlElement

        public IgnoredHtmlElement​(String tagName)
        Create a new IgnoredHtmlElement. The tagname may also be referred to as the NodeName.
        Parameters:
        tagName - The tag name, such as DIV, case-insensitive.
    • Method Detail

      • create

        public static IgnoredHtmlElement create​(String tagName,
                                                String... attributes)
        Utility method to quickly create a new element.
        Parameters:
        tagName - The elements tag name.
        attributes - Zero or more attributes that should be enabled on this tag.
        Returns:
        The newly created element.
      • getTagName

        public String getTagName()
        Returns the tagname for this object.
        Returns:
        The name of this element.
      • getAttributes

        public Set<String> getAttributes()
        Gets all the attributes that should be left on this tag.
        Returns:
        A set of attributes that are left on the tag.
      • addAttribute

        public boolean addAttribute​(String attributeName)
        Adds a single to the list of allowed attributes.
        Parameters:
        attributeName - The name of the attribute to allow.
        Returns:
        true if the attribute was not already set.
      • addAttributes

        public void addAttributes​(String... attributes)
        Adds one or more attributes to the list of allowed attributes.
        Parameters:
        attributes - The attribute names that are to be allowed.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object