HTML Parser Home Page

org.htmlparser.tags
Class MetaTag

java.lang.Object
  extended by org.htmlparser.nodes.AbstractNode
      extended by org.htmlparser.nodes.TagNode
          extended by org.htmlparser.tags.MetaTag
All Implemented Interfaces:
Serializable, Cloneable, Node, Tag

public class MetaTag
extends TagNode

A Meta Tag

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.htmlparser.nodes.TagNode
breakTags, mAttributes, mDefaultScanner
 
Fields inherited from class org.htmlparser.nodes.AbstractNode
children, mPage, nodeBegin, nodeEnd, parent
 
Constructor Summary
MetaTag()
          Create a new meta tag.
 
Method Summary
 void doSemanticAction()
          Perform the META tag semantic action.
 String getHttpEquiv()
          Get the HTTP-EQUIV attribute, if any.
 String[] getIds()
          Return the set of names handled by this tag.
 String getMetaContent()
          Get the CONTENT attribute, if any.
 String getMetaTagName()
          Get the NAME attribute, if any.
 void setHttpEquiv(String httpEquiv)
          Set the HTTP-EQUIV attribute.
 void setMetaTagContents(String metaTagContents)
          Set the CONTENT attribute.
 void setMetaTagName(String metaTagName)
          Set the NAME attribute.
 
Methods inherited from class org.htmlparser.nodes.TagNode
accept, breaksFlow, getAttribute, getAttributeEx, getAttributesEx, getEnders, getEndingLineNumber, getEndTag, getEndTagEnders, getRawTagName, getStartingLineNumber, getTagBegin, getTagEnd, getTagName, getText, getThisScanner, isEmptyXmlTag, isEndTag, removeAttribute, setAttribute, setAttribute, setAttribute, setAttributeEx, setAttributesEx, setEmptyXmlTag, setEndTag, setTagBegin, setTagEnd, setTagName, setText, setThisScanner, toHtml, toPlainTextString, toString
 
Methods inherited from class org.htmlparser.nodes.AbstractNode
clone, collectInto, getChildren, getEndPosition, getFirstChild, getLastChild, getNextSibling, getPage, getParent, getPreviousSibling, getStartPosition, setChildren, setEndPosition, setPage, setParent, setStartPosition, toHtml
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.htmlparser.Node
clone, collectInto, getChildren, getEndPosition, getFirstChild, getLastChild, getNextSibling, getPage, getParent, getPreviousSibling, getStartPosition, setChildren, setEndPosition, setPage, setParent, setStartPosition, toHtml
 

Constructor Detail

MetaTag

public MetaTag()
Create a new meta tag.

Method Detail

getIds

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

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

getHttpEquiv

public String getHttpEquiv()
Get the HTTP-EQUIV attribute, if any.

Returns:
The value of the HTTP-EQUIV attribute, or null if the attribute doesn't exist.

getMetaContent

public String getMetaContent()
Get the CONTENT attribute, if any.

Returns:
The value of the CONTENT attribute, or null if the attribute doesn't exist.

getMetaTagName

public String getMetaTagName()
Get the NAME attribute, if any.

Returns:
The value of the NAME attribute, or null if the attribute doesn't exist.

setHttpEquiv

public void setHttpEquiv(String httpEquiv)
Set the HTTP-EQUIV attribute.

Parameters:
httpEquiv - The new value of the HTTP-EQUIV attribute.

setMetaTagContents

public void setMetaTagContents(String metaTagContents)
Set the CONTENT attribute.

Parameters:
metaTagContents - The new value of the CONTENT attribute.

setMetaTagName

public void setMetaTagName(String metaTagName)
Set the NAME attribute.

Parameters:
metaTagName - The new value of the NAME attribute.

doSemanticAction

public void doSemanticAction()
                      throws ParserException
Perform the META tag semantic action. Check for a charset directive, and if found, set the charset for the page.

Specified by:
doSemanticAction in interface Node
Overrides:
doSemanticAction in class AbstractNode
Throws:
ParserException - If setting the encoding fails.

© 2005 Derrick Oswald
Jun 10, 2006

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