com.meterware.httpunit.javascript
Class JavaScript.Location

java.lang.Object
  extended by org.mozilla.javascript.ScriptableObject
      extended by com.meterware.httpunit.javascript.ScriptingEngineImpl
          extended by com.meterware.httpunit.javascript.JavaScript.Location
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.Location
extends ScriptingEngineImpl

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.Location()
           
 
Method Summary
 void clearCaches()
          Clears any cached values, permitting them to be recomputed as needed.
 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()
           
 java.lang.Object getDefaultValue(java.lang.Class typeHint)
          Returns the default value of this scriptable object.
 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_replace(java.lang.String urlString)
           
 java.lang.String jsGet_host()
           
 java.lang.String jsGet_hostname()
           
 java.lang.String jsGet_href()
           
 java.lang.String jsGet_pathname()
           
 java.lang.String jsGet_port()
           
 java.lang.String jsGet_protocol()
           
 java.lang.String jsGet_search()
           
 void jsSet_href(java.lang.String urlString)
           
 void jsSet_pathname(java.lang.String newPath)
           
 void jsSet_search(java.lang.String newSearch)
           
 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, 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.Location

public JavaScript.Location()
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

jsFunction_replace

public void jsFunction_replace(java.lang.String urlString)
                        throws java.io.IOException,
                               org.xml.sax.SAXException
Throws:
java.io.IOException
org.xml.sax.SAXException

jsGet_href

public java.lang.String jsGet_href()

jsSet_href

public void jsSet_href(java.lang.String urlString)
                throws org.xml.sax.SAXException,
                       java.io.IOException
Throws:
org.xml.sax.SAXException
java.io.IOException

jsGet_protocol

public java.lang.String jsGet_protocol()

jsGet_host

public java.lang.String jsGet_host()

jsGet_hostname

public java.lang.String jsGet_hostname()

jsGet_port

public java.lang.String jsGet_port()

jsGet_pathname

public java.lang.String jsGet_pathname()

jsSet_pathname

public void jsSet_pathname(java.lang.String newPath)
                    throws org.xml.sax.SAXException,
                           java.io.IOException
Throws:
org.xml.sax.SAXException
java.io.IOException

jsGet_search

public java.lang.String jsGet_search()

jsSet_search

public void jsSet_search(java.lang.String newSearch)
                  throws org.xml.sax.SAXException,
                         java.io.IOException
Throws:
org.xml.sax.SAXException
java.io.IOException

getDefaultValue

public java.lang.Object getDefaultValue(java.lang.Class typeHint)
Returns the default value of this scriptable object. In this case, it returns simply the URL as a string. Note that this method is necessary, since Rhino will only call the toString method directly if there are no Rhino methods defined (jsGet_*, jsFunction_*, etc.)

Specified by:
getDefaultValue in interface org.mozilla.javascript.Scriptable
Overrides:
getDefaultValue in class org.mozilla.javascript.ScriptableObject

toString

public java.lang.String toString()

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

newScriptingEngine

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


clearCaches

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


toStringIfNotUndefined

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

toElementArray

protected JavaScript.ElementArray toElementArray(ScriptingHandler[] scriptables)


Copyright © 2011. All Rights Reserved.