org.htmlparser.tags

Class ScriptTag

public class ScriptTag extends CompositeTag

A script tag.
Field Summary
protected StringmCode
Script code if different from the page contents.
Constructor Summary
ScriptTag()
Create a new script tag.
Method Summary
String[]getEndTagEnders()
Return the set of end tag names that cause this tag to finish.
String[]getIds()
Return the set of names handled by this tag.
StringgetLanguage()
Get the LANGUAGE attribute, if any.
StringgetScriptCode()
Get the script code.
StringgetType()
Get the TYPE attribute, 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.
voidsetType(String type)
Set the mime type of the script tag.
StringtoString()
Print the contents of the script tag suitable for debugging display.

Field Detail

mCode

protected String mCode
Script code if different from the page contents.

Constructor Detail

ScriptTag

public ScriptTag()
Create a new script tag.

Method Detail

getEndTagEnders

public String[] getEndTagEnders()
Return the set of end tag names that cause this tag to finish.

Returns: The names of following end tags that stop further scanning.

getIds

public String[] getIds()
Return the set of names handled by this tag.

Returns: The names to be matched that create tags of this type.

getLanguage

public String getLanguage()
Get the LANGUAGE attribute, if any.

Returns: The scripting language.

getScriptCode

public 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.

getType

public String getType()
Get the TYPE attribute, if any.

Returns: The script mime type.

putChildrenInto

protected void putChildrenInto(StringBuffer sb, boolean verbatim)
Places the script contents into the provided buffer.

Parameters: verbatim If true return as close to the original page text as possible. sb The buffer to add the script to.

setLanguage

public void setLanguage(String language)
Set the language of the script tag.

Parameters: language The new language value.

setScriptCode

public void setScriptCode(String code)
Set the code contents.

Parameters: code The new code contents of this tag.

setType

public void setType(String type)
Set the mime type of the script tag.

Parameters: type The new mime type.

toString

public String toString()
Print the contents of the script tag suitable for debugging display.

Returns: The script language or type and code as a string.

HTML Parser is an open source library released under LGPL. SourceForge.net