com.gargoylesoftware.htmlunit.attachment
Class CollectingAttachmentHandler

java.lang.Object
  extended by com.gargoylesoftware.htmlunit.attachment.CollectingAttachmentHandler
All Implemented Interfaces:
AttachmentHandler

public class CollectingAttachmentHandler
extends Object
implements AttachmentHandler

An AttachmentHandler implementation which creates an Attachment for each attached page, collecting all created attachments into a list.

Version:
$Revision: 5301 $
Author:
Bruce Chapman, Sudhan Moghe, Daniel Gredler

Constructor Summary
CollectingAttachmentHandler()
          Creates a new instance.
CollectingAttachmentHandler(List<Attachment> list)
          Creates a new instance which collects attachments into the specified list.
 
Method Summary
 List<Attachment> getCollectedAttachments()
          Returns the list of attachments collected by this attachment handler.
 void handleAttachment(Page page)
          Handles the specified attached page.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectingAttachmentHandler

public CollectingAttachmentHandler()
Creates a new instance.


CollectingAttachmentHandler

public CollectingAttachmentHandler(List<Attachment> list)
Creates a new instance which collects attachments into the specified list.

Parameters:
list - the list to store attachments in
Method Detail

handleAttachment

public void handleAttachment(Page page)
Handles the specified attached page.

Specified by:
handleAttachment in interface AttachmentHandler
Parameters:
page - an attached page, which doesn't get loaded inline

getCollectedAttachments

public List<Attachment> getCollectedAttachments()
Returns the list of attachments collected by this attachment handler. The returned list is modifiable, so that attachments can be removed after being processed.

Returns:
the list of attachments collected by this attachment handler


Copyright © 2002-2010 Gargoyle Software Inc.. All Rights Reserved.