|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gargoylesoftware.htmlunit.ScriptEngine
public abstract class ScriptEngine
An abstract base class for scripting engines.
Method Summary | |
---|---|
abstract java.lang.Object |
callFunction(HtmlPage htmlPage,
java.lang.Object javaScriptFunction,
java.lang.Object thisObject,
java.lang.Object[] args,
DomNode htmlElementScope)
Call a JavaScript function and return the result. |
java.lang.Object |
execute(HtmlPage htmlPage,
java.lang.String sourceCode,
java.lang.String sourceName)
Execute the specified source code in the context of the given page. |
abstract java.lang.Object |
execute(HtmlPage htmlPage,
java.lang.String sourceCode,
java.lang.String sourceName,
HtmlElement htmlElement)
Execute the specified source code in the context of the given page. |
static org.apache.commons.logging.Log |
getScriptEngineLog()
Return the log object that is being used to log information about the script engine. |
WebClient |
getWebClient()
Return the web client that this engine is associated with. |
abstract void |
initialize(WebWindow webWindow)
perform initialization for the given webWindow |
abstract boolean |
isScriptRunning()
Indicates if Script is running in current thread. |
java.lang.String |
preProcess(HtmlPage htmlPage,
java.lang.String sourceCode,
java.lang.String sourceName,
HtmlElement htmlElement)
Pre process the specified source code in the context of the given page using the processor specified in the webclient. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public abstract java.lang.Object callFunction(HtmlPage htmlPage, java.lang.Object javaScriptFunction, java.lang.Object thisObject, java.lang.Object[] args, DomNode htmlElementScope)
htmlPage
- The pagejavaScriptFunction
- The function to call.thisObject
- The this object for class method calls.args
- The list of arguments to pass to the function.htmlElementScope
- The html element that will act as the context.
public java.lang.Object execute(HtmlPage htmlPage, java.lang.String sourceCode, java.lang.String sourceName)
htmlPage
- The pagesourceCode
- The code to execute.sourceName
- A name for the chunk of code that is going to be executed. This will be
used in error messages.
public abstract java.lang.Object execute(HtmlPage htmlPage, java.lang.String sourceCode, java.lang.String sourceName, HtmlElement htmlElement)
htmlPage
- The pagesourceCode
- The code to execute.sourceName
- A name for the chunk of code that is going to be executed. This will be
used in error messages.htmlElement
- The html element that will act as the context.
public static org.apache.commons.logging.Log getScriptEngineLog()
public final WebClient getWebClient()
public abstract void initialize(WebWindow webWindow)
webWindow
- the web window to initialize forpublic abstract boolean isScriptRunning()
true
if script is running.public java.lang.String preProcess(HtmlPage htmlPage, java.lang.String sourceCode, java.lang.String sourceName, HtmlElement htmlElement)
WebClient
. If no pre processor handler is defined, the original source code is returned
unchanged.
htmlPage
- The pagesourceCode
- The code to process.sourceName
- A name for the chunk of code. This will be used in error messages.htmlElement
- The html element that will act as the context.
ScriptPreProcessor
|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |