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
-
public class ScriptTag extends CompositeTag
A script tag.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
mCode
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 Constructor Description ScriptTag()
Create a new script tag.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String[]
getEndTagEnders()
Return the set of end tag names that cause this tag to finish.java.lang.String[]
getIds()
Return the set of names handled by this tag.java.lang.String
getLanguage()
Get theLANGUAGE
attribute, if any.java.lang.String
getScriptCode()
Get the script code.java.lang.String
getType()
Get theTYPE
attribute, if any.protected void
putChildrenInto(java.lang.StringBuffer sb, boolean verbatim)
Places the script contents into the provided buffer.void
setLanguage(java.lang.String language)
Set the language of the script tag.void
setScriptCode(java.lang.String code)
Set the code contents.void
setType(java.lang.String type)
Set the mime type of the script tag.java.lang.String
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
-
-
-
-
Method Detail
-
getIds
public java.lang.String[] getIds()
Return the set of names handled by this tag.
-
getEndTagEnders
public java.lang.String[] 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
public java.lang.String getLanguage()
Get theLANGUAGE
attribute, if any.- Returns:
- The scripting language.
-
getScriptCode
public java.lang.String 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
public void setScriptCode(java.lang.String code)
Set the code contents.- Parameters:
code
- The new code contents of this tag.
-
getType
public java.lang.String getType()
Get theTYPE
attribute, if any.- Returns:
- The script mime type.
-
setLanguage
public void setLanguage(java.lang.String language)
Set the language of the script tag.- Parameters:
language
- The new language value.
-
setType
public void setType(java.lang.String type)
Set the mime type of the script tag.- Parameters:
type
- The new mime type.
-
putChildrenInto
protected void putChildrenInto(java.lang.StringBuffer sb, boolean verbatim)
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
public java.lang.String 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.
-
-