Package org.htmlparser.tags
Class MetaTag
java.lang.Object
org.htmlparser.nodes.AbstractNode
org.htmlparser.nodes.TagNode
org.htmlparser.tags.MetaTag
- All Implemented Interfaces:
Serializable
,Cloneable
,Node
,Tag
A Meta Tag
- See Also:
-
Field Summary
Fields inherited from class org.htmlparser.nodes.TagNode
breakTags, mAttributes, mDefaultScanner
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Perform the META tag semantic action.Get theHTTP-EQUIV
attribute, if any.String[]
getIds()
Return the set of names handled by this tag.Get theCONTENT
attribute, if any.Get theNAME
attribute, if any.void
setHttpEquiv
(String httpEquiv) Set theHTTP-EQUIV
attribute.void
setMetaTagContents
(String metaTagContents) Set theCONTENT
attribute.void
setMetaTagName
(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
-
Constructor Details
-
MetaTag
public MetaTag()Create a new meta tag.
-
-
Method Details
-
getIds
Return the set of names handled by this tag. -
getHttpEquiv
Get theHTTP-EQUIV
attribute, if any.- Returns:
- The value of the
HTTP-EQUIV
attribute, ornull
if the attribute doesn't exist.
-
getMetaContent
Get theCONTENT
attribute, if any.- Returns:
- The value of the
CONTENT
attribute, ornull
if the attribute doesn't exist.
-
getMetaTagName
Get theNAME
attribute, if any.- Returns:
- The value of the
NAME
attribute, ornull
if the attribute doesn't exist.
-
setHttpEquiv
Set theHTTP-EQUIV
attribute.- Parameters:
httpEquiv
- The new value of theHTTP-EQUIV
attribute.
-
setMetaTagContents
Set theCONTENT
attribute.- Parameters:
metaTagContents
- The new value of theCONTENT
attribute.
-
setMetaTagName
Set theNAME
attribute.- Parameters:
metaTagName
- The new value of theNAME
attribute.
-
doSemanticAction
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.
-