java.lang.Object
ScriptableObject
com.meterware.httpunit.javascript.JavaScript.JavaScriptEngine
com.meterware.httpunit.javascript.JavaScript.Document
- All Implemented Interfaces:
- com.meterware.httpunit.scripting.ScriptingEngine
- Enclosing class:
- JavaScript
- public static class JavaScript.Document
- extends JavaScript.JavaScriptEngine
_forms
private JavaScript.ElementArray _forms
_links
private JavaScript.ElementArray _links
_images
private JavaScript.ElementArray _images
_writeBuffer
private java.lang.StringBuffer _writeBuffer
_mimeType
private java.lang.String _mimeType
_scriptable
protected com.meterware.httpunit.scripting.ScriptableDelegate _scriptable
_parent
protected JavaScript.JavaScriptEngine _parent
JavaScript.Document
public JavaScript.Document()
getClassName
public java.lang.String getClassName()
clearCaches
public void clearCaches()
- Description copied from interface:
com.meterware.httpunit.scripting.ScriptingEngine
- Clears any cached values, permitting them to be recomputed as needed.
- Specified by:
clearCaches in interface com.meterware.httpunit.scripting.ScriptingEngine- Overrides:
clearCaches in class JavaScript.JavaScriptEngine
jsGet_title
public java.lang.String jsGet_title()
throws org.xml.sax.SAXException
jsGet_images
public Scriptable jsGet_images()
throws org.xml.sax.SAXException
jsGet_links
public Scriptable jsGet_links()
throws org.xml.sax.SAXException
jsGet_forms
public Scriptable jsGet_forms()
throws org.xml.sax.SAXException
jsFunction_getElementById
public java.lang.Object jsFunction_getElementById(java.lang.String id)
jsFunction_getElementsByName
public java.lang.Object jsFunction_getElementsByName(java.lang.String name)
jsFunction_getElementsByTagName
public java.lang.Object jsFunction_getElementsByTagName(java.lang.String name)
jsGet_location
public java.lang.Object jsGet_location()
jsSet_location
public void jsSet_location(java.lang.String urlString)
throws java.io.IOException,
org.xml.sax.SAXException
jsGet_cookie
public java.lang.String jsGet_cookie()
jsSet_cookie
public void jsSet_cookie(java.lang.String cookieSpec)
getWindow
private JavaScript.Window getWindow()
jsFunction_open
public void jsFunction_open(java.lang.Object mimeType)
jsFunction_close
public void jsFunction_close()
jsFunction_write
public void jsFunction_write(java.lang.String string)
jsFunction_writeln
public void jsFunction_writeln(java.lang.String string)
getWriteBuffer
protected java.lang.StringBuffer getWriteBuffer()
clearWriteBuffer
protected void clearWriteBuffer()
getDelegate
private com.meterware.httpunit.HTMLPage.Scriptable getDelegate()
supportsScriptLanguage
public boolean supportsScriptLanguage(java.lang.String language)
- Description copied from interface:
com.meterware.httpunit.scripting.ScriptingEngine
- Returns true if this engine supports the specified script.
- Specified by:
supportsScriptLanguage in interface com.meterware.httpunit.scripting.ScriptingEngine
executeScript
public java.lang.String executeScript(java.lang.String language,
java.lang.String script)
- Description copied from interface:
com.meterware.httpunit.scripting.ScriptingEngine
- Interprets the specified script, which may include global function definitions.
- Specified by:
executeScript in interface com.meterware.httpunit.scripting.ScriptingEngine
getDocumentWriteBuffer
protected java.lang.StringBuffer getDocumentWriteBuffer()
discardDocumentWriteBuffer
protected void discardDocumentWriteBuffer()
performEvent
public boolean performEvent(java.lang.String eventScript)
- Description copied from interface:
com.meterware.httpunit.scripting.ScriptingEngine
- Interprets the specified script and returns a boolean result.
- Specified by:
performEvent in interface com.meterware.httpunit.scripting.ScriptingEngine
evaluateScriptExpression
public java.lang.String evaluateScriptExpression(java.lang.String urlString)
- Evaluates the specified string as JavaScript. Will return null if the script has no return value.
- Specified by:
evaluateScriptExpression in interface com.meterware.httpunit.scripting.ScriptingEngine
initialize
void initialize(JavaScript.JavaScriptEngine parent,
com.meterware.httpunit.scripting.ScriptableDelegate scriptable)
throws org.xml.sax.SAXException,
PropertyException,
JavaScriptException,
NotAFunctionException
getName
java.lang.String getName()
getID
java.lang.String getID()
has
public boolean has(java.lang.String propertyName,
Scriptable scriptable)
get
public java.lang.Object get(java.lang.String propertyName,
Scriptable scriptable)
get
public java.lang.Object get(int i,
Scriptable scriptable)
put
public void put(java.lang.String propertyName,
Scriptable scriptable,
java.lang.Object value)
toString
public java.lang.String toString()
- Description copied from class:
java.lang.Object
- Convert this Object to a human-readable String.
There are no limits placed on how long this String
should be or what it should contain. We suggest you
make it as intuitive as possible to be able to place
it into System.out.println() 55
and such.
It is typical, but not required, to ensure that this method
never completes abruptly with a java.lang.RuntimeException.
This method will be called when performing string
concatenation with this object. If the result is
null, string concatenation will instead
use "null".
The default implementation returns
getClass().getName() + "@" +
Integer.toHexString(hashCode()).
newScriptingEngine
public com.meterware.httpunit.scripting.ScriptingEngine newScriptingEngine(com.meterware.httpunit.scripting.ScriptableDelegate child)
- Description copied from interface:
com.meterware.httpunit.scripting.ScriptingEngine
- Returns a new scripting engine for the specified delegate.
- Specified by:
newScriptingEngine in interface com.meterware.httpunit.scripting.ScriptingEngine
toStringIfNotUndefined
protected static java.lang.String toStringIfNotUndefined(java.lang.Object object)
toScriptable
final java.lang.Object toScriptable(com.meterware.httpunit.scripting.ScriptableDelegate delegate)
- Converts a scriptable delegate obtained from a subobject into the appropriate Rhino-compatible Scriptable.
toElementArray
protected JavaScript.ElementArray toElementArray(com.meterware.httpunit.scripting.ScriptableDelegate[] scriptables)