Package javanet.staxutils.helpers
Class ListEventConsumer
- java.lang.Object
-
- javanet.staxutils.helpers.ListEventConsumer
-
- All Implemented Interfaces:
XMLEventConsumer
public class ListEventConsumer extends Object implements XMLEventConsumer
XMLEventConsumerthat stores all added events in aList.- Version:
- $Revision: 1.1 $
- Author:
- Christian Niles
-
-
Constructor Summary
Constructors Constructor Description ListEventConsumer()ListEventConsumer(List events)Constructs an instance that adds events to the provided list.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(XMLEvent event)Adds the event to the internal list.ListgetEvents()Returns theListof events added to this consumer.voidreset()Removes all events from the internal list, making it available for reuse.voidsetEvents(List events)Sets theListto which events will be written.
-
-
-
Constructor Detail
-
ListEventConsumer
public ListEventConsumer()
-
ListEventConsumer
public ListEventConsumer(List events)
Constructs an instance that adds events to the provided list.- Parameters:
events- The list to which events will be added, ornull.
-
-
Method Detail
-
add
public void add(XMLEvent event) throws XMLStreamException
Adds the event to the internal list.- Specified by:
addin interfaceXMLEventConsumer- Throws:
XMLStreamException
-
getEvents
public List getEvents()
Returns theListof events added to this consumer.- Returns:
- The
Listof events added to this consumer.
-
setEvents
public void setEvents(List events)
Sets theListto which events will be written.- Parameters:
events- TheListto which events will be written.
-
reset
public void reset()
Removes all events from the internal list, making it available for reuse.
-
-