Package com.meterware.httpunit
Class WebForm.Scriptable
- java.lang.Object
-
- com.meterware.httpunit.scripting.ScriptableDelegate
-
- com.meterware.httpunit.WebForm.Scriptable
-
- All Implemented Interfaces:
DocumentElement,FormScriptable,NamedDelegate,ScriptingEventHandler,ScriptingHandler
- Enclosing class:
- WebForm
public class WebForm.Scriptable extends ScriptableDelegate implements NamedDelegate, FormScriptable
-
-
Field Summary
-
Fields inherited from class com.meterware.httpunit.scripting.ScriptableDelegate
NULL_SCRIPT_ENGINE
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectget(java.lang.String propertyName)get the Object for the given propertyNameprotected HTMLElementget_element()java.lang.StringgetAction()java.lang.StringgetAttribute(java.lang.String attributeName)get the content of the given attributeScriptableDelegate[]getElementDelegates()ScriptableDelegate[]getElementsByTagName(java.lang.String name)java.lang.StringgetName()booleanhandleEvent(java.lang.String eventName)Executes the event Handler script for the specified event (such as onchange, onmousedown, onclick, onmouseup) if it is defined.voidremoveAttribute(java.lang.String attributeName)remove the given attributevoidreset()voidset(java.lang.String propertyName, java.lang.Object value)Sets the value of the named property.voidsetAction(java.lang.String newAction)set the actionvoidsetAttribute(java.lang.String attributeName, java.lang.Object value)set the attribute with the given attribute name to the given valuevoidsetParameterValue(java.lang.String name, java.lang.String value)set the value of a parametervoidsubmit()-
Methods inherited from class com.meterware.httpunit.scripting.ScriptableDelegate
clearCaches, doEvent, doEventScript, evaluateExpression, get, getDelegates, getScriptEngine, getScriptEngine, runScript, setScriptEngine, supportsScriptLanguage
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.meterware.httpunit.scripting.ScriptingEventHandler
doEvent, doEventScript, handleEvent
-
-
-
-
Method Detail
-
getAction
public java.lang.String getAction()
-
setAction
public void setAction(java.lang.String newAction)
Description copied from interface:FormScriptableset the action- Specified by:
setActionin interfaceFormScriptable
-
submit
public void submit() throws java.io.IOException, org.xml.sax.SAXException- Throws:
java.io.IOExceptionorg.xml.sax.SAXException
-
reset
public void reset() throws java.io.IOException, org.xml.sax.SAXException- Throws:
java.io.IOExceptionorg.xml.sax.SAXException
-
getName
public java.lang.String getName()
- Specified by:
getNamein interfaceNamedDelegate
-
get
public java.lang.Object get(java.lang.String propertyName)
get the Object for the given propertyName- Parameters:
propertyName- - the name of the property to get- Returns:
- the Object for the property
-
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.- Overrides:
setin classScriptableDelegate- Parameters:
propertyName- - the name of the propertyvalue- - the new value
-
setParameterValue
public void setParameterValue(java.lang.String name, java.lang.String value)Description copied from interface:FormScriptableset the value of a parameter- Specified by:
setParameterValuein interfaceFormScriptable- Parameters:
name- - the name of the parameter to setvalue- - the value to use for the parameter
-
getElementDelegates
public ScriptableDelegate[] getElementDelegates()
-
getElementsByTagName
public ScriptableDelegate[] getElementsByTagName(java.lang.String name) throws org.xml.sax.SAXException
- Throws:
org.xml.sax.SAXException
-
get_element
protected HTMLElement get_element()
- Returns:
- the _element
-
getAttribute
public java.lang.String getAttribute(java.lang.String attributeName)
get the content of the given attribute- Parameters:
attributeName-- Returns:
- the attribute as a string
-
setAttribute
public void setAttribute(java.lang.String attributeName, java.lang.Object value)set the attribute with the given attribute name to the given value- Parameters:
attributeName-value-
-
removeAttribute
public void removeAttribute(java.lang.String attributeName)
remove the given attribute- Parameters:
attributeName-
-
handleEvent
public boolean handleEvent(java.lang.String eventName)
Description copied from class:ScriptableDelegateExecutes the event Handler script for the specified event (such as onchange, onmousedown, onclick, onmouseup) if it is defined.- Specified by:
handleEventin interfaceScriptingEventHandler- Overrides:
handleEventin classScriptableDelegate- Parameters:
eventName- the name of the event for which a handler should be run.- Returns:
- whether the event with the given name was handled
-
-