com.meterware.httpunit.javascript
Class JavaScript.Document

java.lang.Object
  extended by org.mozilla.javascript.ScriptableObject
      extended by com.meterware.httpunit.javascript.ScriptingEngineImpl
          extended by com.meterware.httpunit.javascript.JavaScript.Document
All Implemented Interfaces:
ScriptingEngine, ScriptingEventHandler, ScriptingHandler, java.io.Serializable, org.mozilla.javascript.ConstProperties, org.mozilla.javascript.debug.DebuggableObject, org.mozilla.javascript.Scriptable
Enclosing class:
JavaScript

public static class JavaScript.Document
extends ScriptingEngineImpl

Document script handling

See Also:
Serialized Form

Field Summary
protected  com.meterware.httpunit.javascript.JavaScript.JavaScriptEngine _parent
           
protected  ScriptableDelegate _scriptable
           
 
Fields inherited from class org.mozilla.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
 
Fields inherited from interface org.mozilla.javascript.Scriptable
NOT_FOUND
 
Constructor Summary
JavaScript.Document()
           
 
Method Summary
 void clearCaches()
          Clears any cached values, permitting them to be recomputed as needed.
protected  void clearWriteBuffer()
           
 java.lang.Object get(int i, org.mozilla.javascript.Scriptable scriptable)
           
 java.lang.Object get(java.lang.String propertyName, org.mozilla.javascript.Scriptable scriptable)
           
 java.lang.String getClassName()
           
protected  java.lang.StringBuffer getWriteBuffer()
           
 boolean handleEvent(java.lang.String eventName)
          get the event Handler script for the event e.g.
 boolean has(java.lang.String propertyName, org.mozilla.javascript.Scriptable scriptable)
           
 void jsFunction_close()
           
 java.lang.Object jsFunction_getElementById(java.lang.String id)
           
 java.lang.Object jsFunction_getElementsByName(java.lang.String name)
           
 java.lang.Object jsFunction_getElementsByTagName(java.lang.String name)
           
 void jsFunction_open(java.lang.Object mimeType)
           
 void jsFunction_write(java.lang.String string)
           
 void jsFunction_writeln(java.lang.String string)
           
 java.lang.String jsGet_cookie()
           
 org.mozilla.javascript.Scriptable jsGet_forms()
           
 org.mozilla.javascript.Scriptable jsGet_images()
           
 org.mozilla.javascript.Scriptable jsGet_links()
           
 java.lang.Object jsGet_location()
           
 java.lang.String jsGet_title()
           
 void jsSet_cookie(java.lang.String cookieSpec)
           
 void jsSet_location(java.lang.String urlString)
           
 ScriptingEngine newScriptingEngine(ScriptableDelegate child)
          Returns a new scripting engine for the specified delegate.
 void put(java.lang.String propertyName, org.mozilla.javascript.Scriptable scriptable, java.lang.Object value)
           
protected  JavaScript.ElementArray toElementArray(ScriptingHandler[] scriptables)
           
 java.lang.String toString()
           
protected static java.lang.String toStringIfNotUndefined(java.lang.Object object)
           
 
Methods inherited from class com.meterware.httpunit.javascript.ScriptingEngineImpl
clearErrorMessages, discardDocumentWriteBuffer, doEvent, doEventScript, evaluateExpression, getDocumentWriteBuffer, getErrorMessages, handleScriptException, runScript, supportsScriptLanguage
 
Methods inherited from class org.mozilla.javascript.ScriptableObject
associateValue, avoidObjectDetection, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, equivalentValues, getAllIds, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, has, hasInstance, hasProperty, hasProperty, isConst, isGetterOrSetter, isSealed, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_scriptable

protected ScriptableDelegate _scriptable

_parent

protected com.meterware.httpunit.javascript.JavaScript.JavaScriptEngine _parent
Constructor Detail

JavaScript.Document

public JavaScript.Document()
Method Detail

getClassName

public java.lang.String getClassName()
Specified by:
getClassName in interface org.mozilla.javascript.Scriptable
Specified by:
getClassName in class org.mozilla.javascript.ScriptableObject

clearCaches

public void clearCaches()
Description copied from interface: ScriptingEngine
Clears any cached values, permitting them to be recomputed as needed.

Specified by:
clearCaches in interface ScriptingEngine
Specified by:
clearCaches in interface ScriptingHandler

jsGet_title

public java.lang.String jsGet_title()
                             throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

jsGet_images

public org.mozilla.javascript.Scriptable jsGet_images()
                                               throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

jsGet_links

public org.mozilla.javascript.Scriptable jsGet_links()
                                              throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

jsGet_forms

public org.mozilla.javascript.Scriptable jsGet_forms()
                                              throws org.xml.sax.SAXException
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
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)

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()

handleEvent

public boolean handleEvent(java.lang.String eventName)
get the event Handler script for the event e.g. onchange, onmousedown, onclick, onmouseup execute the script if it's assigned by calling doEvent for the script

Specified by:
handleEvent in interface ScriptingEventHandler
Overrides:
handleEvent in class ScriptingEngineImpl
Parameters:
eventName -
Returns:

has

public boolean has(java.lang.String propertyName,
                   org.mozilla.javascript.Scriptable scriptable)
Specified by:
has in interface org.mozilla.javascript.Scriptable
Overrides:
has in class org.mozilla.javascript.ScriptableObject

get

public java.lang.Object get(java.lang.String propertyName,
                            org.mozilla.javascript.Scriptable scriptable)
Specified by:
get in interface org.mozilla.javascript.Scriptable
Overrides:
get in class org.mozilla.javascript.ScriptableObject

get

public java.lang.Object get(int i,
                            org.mozilla.javascript.Scriptable scriptable)
Specified by:
get in interface org.mozilla.javascript.Scriptable
Overrides:
get in class org.mozilla.javascript.ScriptableObject

put

public void put(java.lang.String propertyName,
                org.mozilla.javascript.Scriptable scriptable,
                java.lang.Object value)
Specified by:
put in interface org.mozilla.javascript.Scriptable
Overrides:
put in class org.mozilla.javascript.ScriptableObject

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

newScriptingEngine

public ScriptingEngine newScriptingEngine(ScriptableDelegate child)
Description copied from interface: ScriptingEngine
Returns a new scripting engine for the specified delegate.


toStringIfNotUndefined

protected static java.lang.String toStringIfNotUndefined(java.lang.Object object)

toElementArray

protected JavaScript.ElementArray toElementArray(ScriptingHandler[] scriptables)


Copyright © 2011. All Rights Reserved.