Package com.meterware.httpunit

# Class WebImage.Scriptable

java.lang.Object
com.meterware.httpunit.scripting.ScriptableDelegate
com.meterware.httpunit.WebImage.Scriptable

All Implemented Interfaces:
  `DocumentElement`, `NamedDelegate`, `ScriptingEventHandler`, `ScriptingHandler`

Enclosing class:
  `WebImage`

public class WebImage.Scriptable extends ScriptableDelegate implements NamedDelegate

## Field Summary

### Fields inherited from class com.meterware.httpunit.scripting.ScriptableDelegate

`NULL_SCRIPT_ENGINE`

## Constructor Summary

Constructors
Constructor
Description
`Scriptable()`

## Method Summary

Modifier and Type
Method
Description
`Object`
`get(String propertyName)`
get the property with the given name
`protected HTMLElement`
`get_element()`
`String`
`getAttribute(String attributeName)`
get the content of the given attribute
`String`
`getName()`
`boolean`
`handleEvent(String eventName)`
Executes the event Handler script for the specified event (such as onchange, onmousedown, onclick, onmouseup) if it is defined.
`void`
`removeAttribute(String attributeName)`
remove the given attribute
`void`
`set(String propertyName, Object value)`
Sets the value of the named property.
`void`
`setAttribute(String attributeName, Object value)`
set the attribute with the given attribute name to the given value

### 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`

## Constructor Details

### Scriptable

public Scriptable()

## Method Details

### getName

public String getName()

Specified by:
  `getName` in interface `NamedDelegate`

### get

public Object get(String propertyName)
get the property with the given name

Parameters:
  `propertyName` - - the name of the property to get

### set

public void set(String propertyName, Object value)
Description copied from class: `ScriptableDelegate`
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:
  `set` in class `ScriptableDelegate`

### get_element

protected HTMLElement get_element()

Returns:
  the _element

### getAttribute

public String getAttribute(String attributeName)
get the content of the given attribute

Parameters:
  `attributeName` -
Returns:
  the attribute as a string

### setAttribute

public void setAttribute(String attributeName, Object value)
set the attribute with the given attribute name to the given value

Parameters:
  `attributeName` -
  `value` -

### removeAttribute

public void removeAttribute(String attributeName)
remove the given attribute

Parameters:
  `attributeName` -

### handleEvent

public boolean handleEvent(String eventName)
Description copied from class: `ScriptableDelegate`
Executes the event Handler script for the specified event (such as onchange, onmousedown, onclick, onmouseup) if it is defined.

Specified by:
  `handleEvent` in interface `ScriptingEventHandler`
Overrides:
  `handleEvent` in class `ScriptableDelegate`
Parameters:
  `eventName` - the name of the event for which a handler should be run.
Returns:
  whether the event with the given name was handled