org.htmlparser.tags

Class MetaTag

Implemented Interfaces:
Cloneable, Node, Serializable, Tag

public class MetaTag
extends TagNode

A Meta Tag

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, getEndTag, getEndTagEnders, getEnders, getEndingLineNumber, getIds, 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

accept, clone, collectInto, doSemanticAction, getChildren, getEndPosition, getFirstChild, getLastChild, getNextSibling, getPage, getParent, getPreviousSibling, getStartPosition, getText, setChildren, setEndPosition, setPage, setParent, setStartPosition, setText, toHtml, toHtml, toPlainTextString, toString

Constructor Details

MetaTag

public MetaTag()
Create a new meta tag.

Method Details

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 interface AbstractNode
Throws:
ParserException - If setting the encoding fails.

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.

getIds

public String[] getIds()
Return the set of names handled by this tag.
Specified by:
getIds in interface Tag
Overrides:
getIds in interface TagNode
Returns:
The names to be matched that create tags of this type.

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.

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