com.meterware.httpunit.scripting
Class ScriptableDelegate

java.lang.Object
  extended bycom.meterware.httpunit.scripting.ScriptableDelegate
Direct Known Subclasses:
com.meterware.httpunit.HTMLElementScriptable, HTMLPage.Scriptable, WebResponse.Scriptable

public abstract class ScriptableDelegate
extends java.lang.Object

An interface for objects which will be accessible via scripting.

Author:
Russell Gold

Constructor Summary
ScriptableDelegate()
           
 
Method Summary
 boolean doEvent(java.lang.String eventScript)
          Executes the specified scripted event.
 java.lang.String evaluateExpression(java.lang.String urlString)
          Evaluates the specified javascript expression, returning its value.
 java.lang.Object get(int index)
          Returns the value of the index property.
 java.lang.Object get(java.lang.String propertyName)
          Returns the value of the named property.
protected  ScriptableDelegate[] getDelegates(HTMLElement[] elements)
           
 ScriptingEngine getScriptEngine()
           
 ScriptingEngine getScriptEngine(ScriptableDelegate child)
           
 java.lang.String runScript(java.lang.String language, java.lang.String script)
          Executes the specified script, returning any intended replacement text.
 void set(java.lang.String propertyName, java.lang.Object value)
          Sets the value of the named property.
 void setScriptEngine(ScriptingEngine scriptEngine)
          Specifies the scripting engine to be used.
 boolean supportsScript(java.lang.String language)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptableDelegate

public ScriptableDelegate()
Method Detail

supportsScript

public boolean supportsScript(java.lang.String language)

doEvent

public boolean doEvent(java.lang.String eventScript)
Executes the specified scripted event.


runScript

public java.lang.String runScript(java.lang.String language,
                                  java.lang.String script)
Executes the specified script, returning any intended replacement text.

Returns:
the replacement text, which may be empty.

evaluateExpression

public java.lang.String evaluateExpression(java.lang.String urlString)
Evaluates the specified javascript expression, returning its value.


get

public java.lang.Object get(java.lang.String propertyName)
Returns the value of the named property. Will return null if the property does not exist.


get

public java.lang.Object get(int index)
Returns the value of the index property. Will return null if the property does not exist.


set

public void set(java.lang.String propertyName,
                java.lang.Object value)
Sets the value of the named property. Will throw a runtime exception if the property does not exist or cannot accept the specified value.


setScriptEngine

public void setScriptEngine(ScriptingEngine scriptEngine)
Specifies the scripting engine to be used.


getScriptEngine

public ScriptingEngine getScriptEngine()

getScriptEngine

public ScriptingEngine getScriptEngine(ScriptableDelegate child)

getDelegates

protected ScriptableDelegate[] getDelegates(HTMLElement[] elements)

Copyright © 2000-2004 Russell Gold. See license agreement for rights granted.