Package org.htmlparser.tags
Class ScriptTag
java.lang.Object
org.htmlparser.nodes.AbstractNode
org.htmlparser.nodes.TagNode
org.htmlparser.tags.CompositeTag
org.htmlparser.tags.ScriptTag
- All Implemented Interfaces:
Serializable,Cloneable,Node,Tag
A script tag.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringScript code if different from the page contents.Fields inherited from class org.htmlparser.tags.CompositeTag
mDefaultCompositeScanner, mEndTagFields inherited from class org.htmlparser.nodes.TagNode
breakTags, mAttributes, mDefaultScanner -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionString[]Return the set of end tag names that cause this tag to finish.String[]getIds()Return the set of names handled by this tag.Get theLANGUAGEattribute, if any.Get the script code.getType()Get theTYPEattribute, if any.protected voidputChildrenInto(StringBuffer sb, boolean verbatim) Places the script contents into the provided buffer.voidsetLanguage(String language) Set the language of the script tag.voidsetScriptCode(String code) Set the code contents.voidSet the mime type of the script tag.toString()Print the contents of the script tag suitable for debugging display.Methods inherited from class org.htmlparser.tags.CompositeTag
accept, childAt, children, collectInto, digupStringNode, elements, findPositionOf, findPositionOf, findPositionOf, getChild, getChildCount, getChildrenAsNodeArray, getChildrenHTML, getEndTag, getStringText, getText, putEndTagInto, removeChild, searchByName, searchFor, searchFor, searchFor, searchFor, setEndTag, toHtml, toPlainTextString, toStringMethods inherited from class org.htmlparser.nodes.TagNode
breaksFlow, getAttribute, getAttributeEx, getAttributesEx, getEnders, getEndingLineNumber, getRawTagName, getStartingLineNumber, getTagBegin, getTagEnd, getTagName, getThisScanner, isEmptyXmlTag, isEndTag, removeAttribute, setAttribute, setAttribute, setAttribute, setAttributeEx, setAttributesEx, setEmptyXmlTag, setTagBegin, setTagEnd, setTagName, setText, setThisScannerMethods inherited from class org.htmlparser.nodes.AbstractNode
clone, doSemanticAction, getChildren, getEndPosition, getFirstChild, getLastChild, getNextSibling, getPage, getParent, getPreviousSibling, getStartPosition, setChildren, setEndPosition, setPage, setParent, setStartPosition, toHtmlMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.htmlparser.Node
clone, doSemanticAction, getChildren, getEndPosition, getFirstChild, getLastChild, getNextSibling, getPage, getParent, getPreviousSibling, getStartPosition, setChildren, setEndPosition, setPage, setParent, setStartPosition, toHtml
-
Field Details
-
mCode
Script code if different from the page contents.
-
-
Constructor Details
-
ScriptTag
public ScriptTag()Create a new script tag.
-
-
Method Details
-
getIds
Return the set of names handled by this tag. -
getEndTagEnders
Return the set of end tag names that cause this tag to finish.- Specified by:
getEndTagEndersin interfaceTag- Overrides:
getEndTagEndersin classTagNode- Returns:
- The names of following end tags that stop further scanning.
-
getLanguage
Get theLANGUAGEattribute, if any.- Returns:
- The scripting language.
-
getScriptCode
Get the script code. Normally this is the contents of the children, but in the rare case that the script is encoded, this is the plaintext decrypted code.- Returns:
- The plaintext or overridden code contents of the tag.
-
setScriptCode
Set the code contents.- Parameters:
code- The new code contents of this tag.
-
getType
Get theTYPEattribute, if any.- Returns:
- The script mime type.
-
setLanguage
Set the language of the script tag.- Parameters:
language- The new language value.
-
setType
Set the mime type of the script tag.- Parameters:
type- The new mime type.
-
putChildrenInto
Places the script contents into the provided buffer.- Overrides:
putChildrenIntoin classCompositeTag- Parameters:
verbatim- Iftruereturn as close to the original page text as possible.sb- The buffer to add the script to.
-
toString
Print the contents of the script tag suitable for debugging display.- Specified by:
toStringin interfaceNode- Overrides:
toStringin classCompositeTag- Returns:
- The script language or type and code as a string.
-