com.meterware.httpunit.javascript
Class JavaScriptEngineFactory

java.lang.Object
  extended by com.meterware.httpunit.javascript.JavaScriptEngineFactory
All Implemented Interfaces:
ScriptingEngineFactory

public class JavaScriptEngineFactory
extends java.lang.Object
implements ScriptingEngineFactory

An implementation of the scripting engine factory which selects a Rhino-based implementation of JavaScript.

Author:
Russell Gold

Constructor Summary
JavaScriptEngineFactory()
           
 
Method Summary
 void associate(WebResponse response)
          Associates a scripting engine with the specified HTML web response.
 void clearErrorMessages()
          Clears the accumulated script error messages.
 ScriptingHandler createHandler(HTMLElement elementBase)
           
 ScriptingHandler createHandler(WebResponse response)
           
 java.lang.String[] getErrorMessages()
          Returns the accumulated script error messages encountered.
 boolean isEnabled()
          Returns true if this engine is enabled.
 boolean isThrowExceptionsOnError()
          Returns true if script errors cause exceptions to be thrown.
 void load(WebResponse response)
          Runs the 'onload' event (if any) for the specified HTML web response.
 void setThrowExceptionsOnError(boolean throwExceptions)
          Determines whether script errors result in exceptions or warning messages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaScriptEngineFactory

public JavaScriptEngineFactory()
Method Detail

isEnabled

public boolean isEnabled()
Description copied from interface: ScriptingEngineFactory
Returns true if this engine is enabled.

Specified by:
isEnabled in interface ScriptingEngineFactory

associate

public void associate(WebResponse response)
Description copied from interface: ScriptingEngineFactory
Associates a scripting engine with the specified HTML web response.

Specified by:
associate in interface ScriptingEngineFactory

load

public void load(WebResponse response)
Description copied from interface: ScriptingEngineFactory
Runs the 'onload' event (if any) for the specified HTML web response. Will associate a scripting engine with the response if that has not already been done.

Specified by:
load in interface ScriptingEngineFactory

setThrowExceptionsOnError

public void setThrowExceptionsOnError(boolean throwExceptions)
Description copied from interface: ScriptingEngineFactory
Determines whether script errors result in exceptions or warning messages.

Specified by:
setThrowExceptionsOnError in interface ScriptingEngineFactory

isThrowExceptionsOnError

public boolean isThrowExceptionsOnError()
Description copied from interface: ScriptingEngineFactory
Returns true if script errors cause exceptions to be thrown.

Specified by:
isThrowExceptionsOnError in interface ScriptingEngineFactory

getErrorMessages

public java.lang.String[] getErrorMessages()
Description copied from interface: ScriptingEngineFactory
Returns the accumulated script error messages encountered. Error messages are accumulated only if 'throwExceptionsOnError' is disabled.

Specified by:
getErrorMessages in interface ScriptingEngineFactory

clearErrorMessages

public void clearErrorMessages()
Description copied from interface: ScriptingEngineFactory
Clears the accumulated script error messages.

Specified by:
clearErrorMessages in interface ScriptingEngineFactory

createHandler

public ScriptingHandler createHandler(HTMLElement elementBase)
Specified by:
createHandler in interface ScriptingEngineFactory

createHandler

public ScriptingHandler createHandler(WebResponse response)
Specified by:
createHandler in interface ScriptingEngineFactory


Copyright © 2011. All Rights Reserved.