com.gargoylesoftware.htmlunit
Class ScriptResult

java.lang.Object
  extended by com.gargoylesoftware.htmlunit.ScriptResult

public final class ScriptResult
extends Object

This object contains the result of executing a chunk of script code.

Version:
$Revision: 5301 $
Author:
Mike Bowler, Marc Guillemot

Constructor Summary
ScriptResult(Object javaScriptResult, Page newPage)
          Creates a new instance.
 
Method Summary
static ScriptResult combine(ScriptResult newResult, ScriptResult originalResult, boolean ie)
          Creates and returns a composite ScriptResult based on the two input ScriptResults.
 Object getJavaScriptResult()
          Returns the object that was the output of the script engine.
 Page getNewPage()
          Returns the page that is loaded at the end of the script execution.
static boolean isFalse(ScriptResult scriptResult)
          Utility method testing if a script result is false.
static boolean isUndefined(ScriptResult scriptResult)
          Utility method testing if a script result is undefined (there was no return value).
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScriptResult

public ScriptResult(Object javaScriptResult,
                    Page newPage)
Creates a new instance.

Parameters:
javaScriptResult - the object that was returned from the script engine
newPage - the page that is currently loaded at the end of the script execution
Method Detail

getJavaScriptResult

public Object getJavaScriptResult()
Returns the object that was the output of the script engine.

Returns:
the result from the script engine

getNewPage

public Page getNewPage()
Returns the page that is loaded at the end of the script execution.

Returns:
the new page

toString

public String toString()

Overrides:
toString in class Object

isFalse

public static boolean isFalse(ScriptResult scriptResult)
Utility method testing if a script result is false.

Parameters:
scriptResult - a script result (may be null)
Returns:
true if scriptResult is false

isUndefined

public static boolean isUndefined(ScriptResult scriptResult)
Utility method testing if a script result is undefined (there was no return value).

Parameters:
scriptResult - a script result (may be null)
Returns:
true if scriptResult is undefined (there was no return value)

combine

public static ScriptResult combine(ScriptResult newResult,
                                   ScriptResult originalResult,
                                   boolean ie)
Creates and returns a composite ScriptResult based on the two input ScriptResults. This method defines how the return values for multiple event handlers are combined during event capturing and bubbling. The behavior of this method varies based on whether or not we are emulating IE.

Parameters:
newResult - the new ScriptResult (may be null)
originalResult - the original ScriptResult (may be null)
ie - whether or not we are emulating IE
Returns:
a composite ScriptResult, based on the two input ScriptResults


Copyright © 2002-2010 Gargoyle Software Inc.. All Rights Reserved.