it.openutils.testing.junit.dwr
Class XMLHttpRequest

java.lang.Object
  extended by org.mozilla.javascript.ScriptableObject
      extended by it.openutils.testing.junit.dwr.XMLHttpRequest
All Implemented Interfaces:
java.io.Serializable, org.mozilla.javascript.ConstProperties, org.mozilla.javascript.debug.DebuggableObject, org.mozilla.javascript.Scriptable

public class XMLHttpRequest
extends org.mozilla.javascript.ScriptableObject

XMLHttpRequest simulates the Mozilla XMLHttpRequest. Add this class to the Rhino classpath and then define to Rhino with defineClass('xmlhttp.XMLHttpRequest');

Author:
Ant Elder
See Also:
Serialized Form

Field Summary
 
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
XMLHttpRequest()
           
 
Method Summary
 java.lang.String getClassName()
           
 void jsConstructor()
           
 void jsFunction_abort()
           
 java.util.Map<java.lang.String,java.lang.String[]> jsFunction_getAllResponseHeaders()
           
 java.lang.String jsFunction_getResponseHeader(java.lang.String headerName)
           
 void jsFunction_open(java.lang.String httpMethod, java.lang.String url, boolean asyncFlag, java.lang.String userName, java.lang.String password)
           
 void jsFunction_send(java.lang.Object o)
           
 void jsFunction_setRequestHeader(java.lang.String headerName, java.lang.String value)
           
 java.lang.Object jsGet_onreadystatechange()
           
 int jsGet_readyState()
           
 java.lang.String jsGet_responseText()
           
 org.w3c.dom.Document jsGet_responseXML()
           
 int jsGet_status()
           
 java.lang.String jsGet_statusText()
           
 void jsSet_onreadystatechange(org.mozilla.javascript.NativeFunction function)
           
 
Methods inherited from class org.mozilla.javascript.ScriptableObject
associateValue, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, equivalentValues, get, get, getAllIds, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, has, has, hasInstance, hasProperty, hasProperty, isConst, isSealed, put, 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, toString, wait, wait, wait
 

Constructor Detail

XMLHttpRequest

public XMLHttpRequest()
Method Detail

jsConstructor

public void jsConstructor()

getClassName

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

jsFunction_setRequestHeader

public void jsFunction_setRequestHeader(java.lang.String headerName,
                                        java.lang.String value)

jsFunction_getAllResponseHeaders

public java.util.Map<java.lang.String,java.lang.String[]> jsFunction_getAllResponseHeaders()

jsFunction_getResponseHeader

public java.lang.String jsFunction_getResponseHeader(java.lang.String headerName)

jsFunction_open

public void jsFunction_open(java.lang.String httpMethod,
                            java.lang.String url,
                            boolean asyncFlag,
                            java.lang.String userName,
                            java.lang.String password)

jsFunction_send

public void jsFunction_send(java.lang.Object o)
                     throws org.xml.sax.SAXException,
                            java.net.MalformedURLException,
                            java.io.IOException
Throws:
org.xml.sax.SAXException
java.net.MalformedURLException
java.io.IOException

jsFunction_abort

public void jsFunction_abort()

jsGet_readyState

public int jsGet_readyState()
Returns:
Returns the readyState.

jsGet_responseText

public java.lang.String jsGet_responseText()
Returns:
Returns the responseText.

jsGet_responseXML

public org.w3c.dom.Document jsGet_responseXML()
Returns:
Returns the responseXML as a DOM Document.

jsGet_status

public int jsGet_status()
Returns:
Returns the htto status.

jsGet_statusText

public java.lang.String jsGet_statusText()
Returns:
Returns the http status text.

jsGet_onreadystatechange

public java.lang.Object jsGet_onreadystatechange()
Returns:
Returns the onreadystatechange.

jsSet_onreadystatechange

public void jsSet_onreadystatechange(org.mozilla.javascript.NativeFunction function)
Parameters:
onreadystatechange - The onreadystatechange to set.


Copyright © 2007 Openmind. All Rights Reserved.