com.overzealous.remark
Class IgnoredHtmlElement

java.lang.Object
  extended by 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
IgnoredHtmlElement(String tagName)
          Create a new IgnoredHtmlElement.
 
Method Summary
 boolean addAttribute(String attributeName)
          Adds a single to the list of allowed attributes.
 void addAttributes(String... attributes)
          Adds one or more attributes to the list of allowed attributes.
static IgnoredHtmlElement create(String tagName, String... attributes)
          Utility method to quickly create a new element.
 boolean equals(Object o)
           
 Set<String> getAttributes()
          Gets all the attributes that should be left on this tag.
 String getTagName()
          Returns the tagname for this object.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

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.

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


© 2011 OverZealous Creations, LLC - BitBucket Repository