com.gargoylesoftware.htmlunit
Class CollectingAlertHandler

java.lang.Object
  extended by com.gargoylesoftware.htmlunit.CollectingAlertHandler
All Implemented Interfaces:
AlertHandler

public class CollectingAlertHandler
extends java.lang.Object
implements AlertHandler

A simple alert handler that keeps track of alerts in a list.

Version:
$Revision: 1.3 $
Author:
Mike Bowler

Constructor Summary
CollectingAlertHandler()
 Create an instance with an ArrayList
CollectingAlertHandler(java.util.List list)
 Create an instance with the specified list.
 
Method Summary
 java.util.List getCollectedAlerts()
 Return a list containing the message portion of any collected alerts.
 void handleAlert(Page page, java.lang.String message)
 Handle the alert.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectingAlertHandler

public CollectingAlertHandler()
Create an instance with an ArrayList


CollectingAlertHandler

public CollectingAlertHandler(java.util.List list)
Create an instance with the specified list.

Parameters:
list - The list to store alerts in.
Method Detail

getCollectedAlerts

public java.util.List getCollectedAlerts()
Return a list containing the message portion of any collected alerts.

Returns:
a list of alert messages

handleAlert

public void handleAlert(Page page,
                        java.lang.String message)
Handle the alert. This implementation will store the message in a list for retrieval later.

Specified by:
handleAlert in interface AlertHandler
Parameters:
page - The page that triggered the alert
message - The message in the alert.


Copyright © 2003-2016 AppPerfect Corporation. All Rights Reserved.