Package org.htmlunit

Class ScriptResult


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

      Constructors 
      Constructor Description
      ScriptResult​(java.lang.Object javaScriptResult)
      Creates a new instance.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object getJavaScriptResult()
      Returns the object that was the output of the script engine.
      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).
      java.lang.String toString()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ScriptResult

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

      • getJavaScriptResult

        public java.lang.Object getJavaScriptResult()
        Returns the object that was the output of the script engine.
        Returns:
        the result from the script engine
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.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)