util
Class HTMLElement

java.lang.Object
  |
  +--util.HTMLElement

public class HTMLElement
extends Object

HTMLElement is a representation of a javax.swing.text.Element that provides some useful interfaces.


Constructor Summary
HTMLElement(Element eInput)
          Creates a new HTMLElement instance from an input javax.swing.text.Element.
 
Method Summary
 boolean containsAttribute(String sAttribName)
          Returns true if this element has the named attribute.
 String getAttribute(HTML.Attribute hAttribute)
          Returns the string value of the attribute with the given attribute key.
 String getAttribute(String sAttribName)
          Returns the string value of the attribute with the given attribute name.
 int getAttributeCount()
          Returns the number of attributes of this element.
 AttributeSet getAttributes()
          Returns this element's attribute set.
 Document getDocument()
          Gets the associated document.
 String getName()
          Gets the name of this element.
 String getText()
          Gets the text between the tag anchors.
 String toString()
          Returns a string representation of this.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HTMLElement

public HTMLElement(Element eInput)
Creates a new HTMLElement instance from an input javax.swing.text.Element.
Parameters:
eInput - a javax.swing.text.Element value
Method Detail

containsAttribute

public boolean containsAttribute(String sAttribName)
Returns true if this element has the named attribute.
Parameters:
sAttribName - a String value
Returns:
a boolean value

getAttributes

public AttributeSet getAttributes()
Returns this element's attribute set.
Returns:
an AttributeSet value

getAttribute

public String getAttribute(HTML.Attribute hAttribute)
Returns the string value of the attribute with the given attribute key. For example, thisElement.getAttribute(HTML.Attribute.CLASS);
Parameters:
hAttribute - a HTML.Attribute value
Returns:
a String value

getAttribute

public String getAttribute(String sAttribName)
Returns the string value of the attribute with the given attribute name. For example, thisElement.getAttribute("class");
Parameters:
sAttribName - a String value
Returns:
a String value

getAttributeCount

public int getAttributeCount()
Returns the number of attributes of this element.
Returns:
an int value

getText

public String getText()
Gets the text between the tag anchors. For example, for

Hello World

, getText() returns "Hello World"
Returns:
a String value

getName

public String getName()
Gets the name of this element.
Returns:
a String value

getDocument

public Document getDocument()
Gets the associated document.
Returns:
a javax.swing.text.Document value

toString

public String toString()
Returns a string representation of this.
Overrides:
toString in class Object
Returns:
a String value