Package org.htmlparser.tags
Class MetaTag
- java.lang.Object
-
- org.htmlparser.nodes.AbstractNode
-
- org.htmlparser.nodes.TagNode
-
- org.htmlparser.tags.MetaTag
-
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
-
-
Constructor Summary
Constructors Constructor Description MetaTag()
Create a new meta tag.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doSemanticAction()
Perform the META tag semantic action.java.lang.String
getHttpEquiv()
Get theHTTP-EQUIV
attribute, if any.java.lang.String[]
getIds()
Return the set of names handled by this tag.java.lang.String
getMetaContent()
Get theCONTENT
attribute, if any.java.lang.String
getMetaTagName()
Get theNAME
attribute, if any.void
setHttpEquiv(java.lang.String httpEquiv)
Set theHTTP-EQUIV
attribute.void
setMetaTagContents(java.lang.String metaTagContents)
Set theCONTENT
attribute.void
setMetaTagName(java.lang.String metaTagName)
Set theNAME
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
-
-
-
-
Method Detail
-
getIds
public java.lang.String[] getIds()
Return the set of names handled by this tag.
-
getHttpEquiv
public java.lang.String getHttpEquiv()
Get theHTTP-EQUIV
attribute, if any.- Returns:
- The value of the
HTTP-EQUIV
attribute, ornull
if the attribute doesn't exist.
-
getMetaContent
public java.lang.String getMetaContent()
Get theCONTENT
attribute, if any.- Returns:
- The value of the
CONTENT
attribute, ornull
if the attribute doesn't exist.
-
getMetaTagName
public java.lang.String getMetaTagName()
Get theNAME
attribute, if any.- Returns:
- The value of the
NAME
attribute, ornull
if the attribute doesn't exist.
-
setHttpEquiv
public void setHttpEquiv(java.lang.String httpEquiv)
Set theHTTP-EQUIV
attribute.- Parameters:
httpEquiv
- The new value of theHTTP-EQUIV
attribute.
-
setMetaTagContents
public void setMetaTagContents(java.lang.String metaTagContents)
Set theCONTENT
attribute.- Parameters:
metaTagContents
- The new value of theCONTENT
attribute.
-
setMetaTagName
public void setMetaTagName(java.lang.String metaTagName)
Set theNAME
attribute.- Parameters:
metaTagName
- The new value of theNAME
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 interfaceNode
- Overrides:
doSemanticAction
in classAbstractNode
- Throws:
ParserException
- If setting the encoding fails.
-
-