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 String
Script code if different from the page contents.Fields inherited from class org.htmlparser.tags.CompositeTag
mDefaultCompositeScanner, mEndTag
Fields 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 theLANGUAGE
attribute, if any.Get the script code.getType()
Get theTYPE
attribute, if any.protected void
putChildrenInto
(StringBuffer sb, boolean verbatim) Places the script contents into the provided buffer.void
setLanguage
(String language) Set the language of the script tag.void
setScriptCode
(String code) Set the code contents.void
Set 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, toString
Methods 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, setThisScanner
Methods inherited from class org.htmlparser.nodes.AbstractNode
clone, doSemanticAction, 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, 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:
getEndTagEnders
in interfaceTag
- Overrides:
getEndTagEnders
in classTagNode
- Returns:
- The names of following end tags that stop further scanning.
-
getLanguage
Get theLANGUAGE
attribute, 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 theTYPE
attribute, 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:
putChildrenInto
in classCompositeTag
- Parameters:
verbatim
- Iftrue
return 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:
toString
in interfaceNode
- Overrides:
toString
in classCompositeTag
- Returns:
- The script language or type and code as a string.
-