com.quiotix.html.parser
Class HtmlDocument.Tag

java.lang.Object
  extended by com.quiotix.html.parser.HtmlDocument.HtmlElement
      extended by com.quiotix.html.parser.HtmlDocument.Tag
All Implemented Interfaces:
Sized, Visitable
Enclosing class:
HtmlDocument

public static class HtmlDocument.Tag
extends HtmlDocument.HtmlElement

HTML start tag. Stores the tag name and a list of tag attributes.


Field Summary
 HtmlDocument.AttributeList attributeList
          A List of the tags Attributes.
 boolean emptyTag
          Whether the tag has an empty content model eg the BR and HR tags.
 String tagName
          The name of the tag.
 
Constructor Summary
HtmlDocument.Tag(String t, HtmlDocument.AttributeList a)
          Constructor.
 
Method Summary
 void accept(HtmlVisitor v)
          Allow the Visitor to visit.
 String getAttributeValue(String name)
           
 int getLength()
           
 boolean hasAttribute(String name)
          Whether Tag has an Attribute with given name.
 boolean hasAttributeValue(String name)
          Whether Tag has an Attribute with given name and that Attribute has a non-null value.
 void setEmpty(boolean b)
          Set Tag type to Empty.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

tagName

public String tagName
The name of the tag.


attributeList

public HtmlDocument.AttributeList attributeList
A List of the tags Attributes.


emptyTag

public boolean emptyTag
Whether the tag has an empty content model eg the BR and HR tags.

Constructor Detail

HtmlDocument.Tag

public HtmlDocument.Tag(String t,
                        HtmlDocument.AttributeList a)
Constructor.

Method Detail

setEmpty

public void setEmpty(boolean b)
Set Tag type to Empty.


accept

public void accept(HtmlVisitor v)
Description copied from interface: Visitable
Allow the Visitor to visit.

Specified by:
accept in interface Visitable
Specified by:
accept in class HtmlDocument.HtmlElement
Parameters:
v - the visitor which has come to call

hasAttribute

public boolean hasAttribute(String name)
Whether Tag has an Attribute with given name.


hasAttributeValue

public boolean hasAttributeValue(String name)
Whether Tag has an Attribute with given name and that Attribute has a non-null value.


getAttributeValue

public String getAttributeValue(String name)
Returns:
the value of the Attribute with the given name or null

getLength

public int getLength()
Returns:
the number of characters

toString

public String toString()
Overrides:
toString in class Object


Copyright © 1999-2011 Quiotix. All Rights Reserved.