Package com.overzealous.remark
Class IgnoredHtmlElement
- java.lang.Object
-
- com.overzealous.remark.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 Summary
Constructors Constructor Description IgnoredHtmlElement(String tagName)Create a new IgnoredHtmlElement.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddAttribute(String attributeName)Adds a single to the list of allowed attributes.voidaddAttributes(String... attributes)Adds one or more attributes to the list of allowed attributes.static IgnoredHtmlElementcreate(String tagName, String... attributes)Utility method to quickly create a new element.booleanequals(Object o)Set<String>getAttributes()Gets all the attributes that should be left on this tag.StringgetTagName()Returns the tagname for this object.inthashCode()
-
-
-
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 asDIV, 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.
-
-