HTML Parser Home Page

org.htmlparser.tags
Class BaseHrefTag

java.lang.Object
  extended byorg.htmlparser.AbstractNode
      extended byorg.htmlparser.lexer.nodes.TagNode
          extended byorg.htmlparser.tags.Tag
              extended byorg.htmlparser.tags.BaseHrefTag
All Implemented Interfaces:
Cloneable, Node, Serializable

public class BaseHrefTag
extends Tag

BaseHrefTag represents an <Base> tag. It extends a basic tag by providing an accessor to the HREF attribute.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.htmlparser.tags.Tag
mDefaultScanner
 
Fields inherited from class org.htmlparser.lexer.nodes.TagNode
breakTags, mAttributes
 
Fields inherited from class org.htmlparser.AbstractNode
children, mPage, nodeBegin, nodeEnd, parent
 
Constructor Summary
BaseHrefTag()
          Create a new base tag.
 
Method Summary
 void doSemanticAction()
          Perform the meaning of this tag.
 String getBaseUrl()
          Get the value of the HREF attribute, if any.
 String[] getIds()
          Return the set of names handled by this tag.
 void setBaseUrl(String base)
           
 
Methods inherited from class org.htmlparser.tags.Tag
accept, accept, clone, getEnders, getEndTagEnders, getThisScanner, setThisScanner
 
Methods inherited from class org.htmlparser.lexer.nodes.TagNode
breaksFlow, getAttribute, getAttributeEx, getAttributes, getAttributesEx, getEndingLineNumber, getParameter, getParsed, getRawTagName, getStartingLineNumber, getTagBegin, getTagEnd, getTagName, getText, isEmptyXmlTag, isEndTag, removeAttribute, setAttribute, setAttribute, setAttribute, setAttributes, setAttributesEx, setEmptyXmlTag, setTagBegin, setTagEnd, setTagName, setText, toHtml, toPlainTextString, toString
 
Methods inherited from class org.htmlparser.AbstractNode
collectInto, elementBegin, elementEnd, getChildren, getEndPosition, getPage, getParent, getStartPosition, setChildren, setEndPosition, setPage, setParent, setStartPosition, toHTML
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BaseHrefTag

public BaseHrefTag()
Create a new base tag.

Method Detail

getIds

public String[] getIds()
Return the set of names handled by this tag.

Overrides:
getIds in class Tag
Returns:
The names to be matched that create tags of this type.

getBaseUrl

public String getBaseUrl()
Get the value of the HREF attribute, if any.

Returns:
The HREF value, with the last slash removed, if any.

setBaseUrl

public void setBaseUrl(String base)

doSemanticAction

public void doSemanticAction()
                      throws ParserException
Perform the meaning of this tag. This sets the base URL to use for the rest of the page.

Specified by:
doSemanticAction in interface Node
Overrides:
doSemanticAction in class AbstractNode
Throws:
ParserException

© 2004 Somik Raha
Mar 14, 2004

HTML Parser is an open source library released under LGPL.
SourceForge.net