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 voiddoSemanticAction()Perform the META tag semantic action.java.lang.StringgetHttpEquiv()Get theHTTP-EQUIVattribute, if any.java.lang.String[]getIds()Return the set of names handled by this tag.java.lang.StringgetMetaContent()Get theCONTENTattribute, if any.java.lang.StringgetMetaTagName()Get theNAMEattribute, if any.voidsetHttpEquiv(java.lang.String httpEquiv)Set theHTTP-EQUIVattribute.voidsetMetaTagContents(java.lang.String metaTagContents)Set theCONTENTattribute.voidsetMetaTagName(java.lang.String metaTagName)Set theNAMEattribute.-
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-EQUIVattribute, if any.- Returns:
- The value of the
HTTP-EQUIVattribute, ornullif the attribute doesn't exist.
-
getMetaContent
public java.lang.String getMetaContent()
Get theCONTENTattribute, if any.- Returns:
- The value of the
CONTENTattribute, ornullif the attribute doesn't exist.
-
getMetaTagName
public java.lang.String getMetaTagName()
Get theNAMEattribute, if any.- Returns:
- The value of the
NAMEattribute, ornullif the attribute doesn't exist.
-
setHttpEquiv
public void setHttpEquiv(java.lang.String httpEquiv)
Set theHTTP-EQUIVattribute.- Parameters:
httpEquiv- The new value of theHTTP-EQUIVattribute.
-
setMetaTagContents
public void setMetaTagContents(java.lang.String metaTagContents)
Set theCONTENTattribute.- Parameters:
metaTagContents- The new value of theCONTENTattribute.
-
setMetaTagName
public void setMetaTagName(java.lang.String metaTagName)
Set theNAMEattribute.- Parameters:
metaTagName- The new value of theNAMEattribute.
-
doSemanticAction
public void doSemanticAction() throws ParserExceptionPerform the META tag semantic action. Check for a charset directive, and if found, set the charset for the page.- Specified by:
doSemanticActionin interfaceNode- Overrides:
doSemanticActionin classAbstractNode- Throws:
ParserException- If setting the encoding fails.
-
-