com.meterware.httpunit

Class WebRequestSource

public abstract class WebRequestSource extends ParameterHolder implements HTMLElement

Base class for objects which can be clicked to generate new web requests.

Author: Russell Gold

Method Summary
protected abstract voidaddPresetParameter(String name, String value)
Records a parameter defined by including it in the destination URL.
StringgetAttribute(String name)
protected WebResponsegetBaseResponse()
Returns the web response containing this request source.
protected URLgetBaseURL()
StringgetClassName()
Returns the class associated with this request source.
protected WebResponsegetCurrentFrameContents()
protected StringgetDestination()
NodegetDOMSubtree()
Returns a copy of the domain object model subtree associated with this entity.
protected abstract StringgetEmptyParameterValue()
StringgetFragmentIdentifier()
Returns the fragment identifier for this request source, used to identifier an element within an HTML document.
FrameSelectorgetFrame()
Returns the frame containing this request source.
protected HTMLPagegetHTMLPage()
Returns the HTMLPage associated with this request source.
StringgetID()
Returns the ID associated with this request source.
StringgetName()
Returns the name associated with this request source.
protected NodegetNode()
Returns the actual DOM for this request source, not a copy.
StringgetPageFrame()
Returns the name of the frame containing this request source.
abstract String[]getParameterNames()
Returns an array containing the names of any parameters to be sent on a request based on this request source.
abstract String[]getParameterValues(String name)
Returns the values of the named parameter.
protected StringgetRelativeURL()
abstract WebRequestgetRequest()
Creates and returns a web request from this request source.
StringgetTagName()
StringgetTarget()
Returns the target for this request source.
StringgetText()
Returns the text value of this block.
StringgetTitle()
Returns the title associated with this request source.
booleanisSupportedAttribute(String name)
protected voidloadDestinationParameters()
Extracts any parameters specified as part of the destination URL, calling addPresetParameter for each one in the order in which they are found.
protected voidsetDestination(String destination)
protected voidsetTargetAttribute(String value)
protected WebResponsesubmitRequest(String event, WebRequest request)
protected WebResponsesubmitRequest(WebRequest request)
Submits a request to the web client from which this request source was originally obtained.

Method Detail

addPresetParameter

protected abstract void addPresetParameter(String name, String value)
Records a parameter defined by including it in the destination URL. The value can be null, if the parameter name was not specified with an equals sign.

getAttribute

public String getAttribute(String name)

getBaseResponse

protected final WebResponse getBaseResponse()
Returns the web response containing this request source.

getBaseURL

protected URL getBaseURL()

getClassName

public String getClassName()
Returns the class associated with this request source.

getCurrentFrameContents

protected WebResponse getCurrentFrameContents()

getDestination

protected String getDestination()

getDOMSubtree

public Node getDOMSubtree()
Returns a copy of the domain object model subtree associated with this entity.

getEmptyParameterValue

protected abstract String getEmptyParameterValue()

getFragmentIdentifier

public String getFragmentIdentifier()
Returns the fragment identifier for this request source, used to identifier an element within an HTML document.

getFrame

public FrameSelector getFrame()
Returns the frame containing this request source.

getHTMLPage

protected HTMLPage getHTMLPage()
Returns the HTMLPage associated with this request source.

getID

public String getID()
Returns the ID associated with this request source.

getName

public String getName()
Returns the name associated with this request source.

getNode

protected Node getNode()
Returns the actual DOM for this request source, not a copy.

getPageFrame

public String getPageFrame()

Deprecated: as of 1.6, use #getFrame

Returns the name of the frame containing this request source.

getParameterNames

public abstract String[] getParameterNames()
Returns an array containing the names of any parameters to be sent on a request based on this request source.

getParameterValues

public abstract String[] getParameterValues(String name)
Returns the values of the named parameter.

getRelativeURL

protected String getRelativeURL()

getRequest

public abstract WebRequest getRequest()
Creates and returns a web request from this request source.

getTagName

public String getTagName()

getTarget

public String getTarget()
Returns the target for this request source.

getText

public String getText()
Returns the text value of this block.

getTitle

public String getTitle()
Returns the title associated with this request source.

isSupportedAttribute

public boolean isSupportedAttribute(String name)

loadDestinationParameters

protected final void loadDestinationParameters()
Extracts any parameters specified as part of the destination URL, calling addPresetParameter for each one in the order in which they are found.

setDestination

protected void setDestination(String destination)

setTargetAttribute

protected void setTargetAttribute(String value)

submitRequest

protected WebResponse submitRequest(String event, WebRequest request)

submitRequest

protected final WebResponse submitRequest(WebRequest request)
Submits a request to the web client from which this request source was originally obtained.