## javanet.staxutils.helpers
Class ListEventConsumer

    java.lang.Object
      javanet.staxutils.helpers.ListEventConsumer

All Implemented Interfaces:
  XMLEventConsumer

    public class ListEventConsumer

extends Object
implements XMLEventConsumer

`XMLEventConsumer` that stores all added events in a `List`.

Version:
  $Revision: 1.1 $
Author:
  Christian Niles

Constructor Summary
`ListEventConsumer()`
`ListEventConsumer(List events)` Constructs an instance that adds events to the provided list.

Method Summary
`void` `add(XMLEvent event)` Adds the event to the internal list.
`List` `getEvents()` Returns the `List` of events added to this consumer.
`void` `reset()` Removes all events from the internal list, making it available for reuse.
`void` `setEvents(List events)` Sets the `List` to which events will be written.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

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, or `null`.

Method Detail

### add

    public void add(XMLEvent event)
             throws XMLStreamException

  Adds the event to the internal list.

  Specified by:
    `add` in interface `XMLEventConsumer`
  Throws:
    `XMLStreamException`

### getEvents

    public List getEvents()

  Returns the `List` of events added to this consumer.

  Returns:
    The `List` of events added to this consumer.

### setEvents

    public void setEvents(List events)

  Sets the `List` to which events will be written.

  Parameters:
    `events` - The `List` to which events will be written.

### reset

    public void reset()

  Removes all events from the internal list, making it available for reuse.