Package org.htmlunit

Class ScriptResult

java.lang.Object
org.htmlunit.ScriptResult

public final class ScriptResult extends Object
This object contains the result of executing a chunk of script code.
  • Constructor Details

    • ScriptResult

      public ScriptResult(Object javaScriptResult)
      Creates a new instance.
      Parameters:
      javaScriptResult - the object that was returned from the script engine
  • Method Details

    • getJavaScriptResult

      public Object getJavaScriptResult()
      Returns the object that was the output of the script engine.
      Returns:
      the result from the script engine
    • 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)