public class ListEventConsumer
extends java.lang.Object
implements javax.xml.stream.util.XMLEventConsumer
XMLEventConsumer that stores all added events in a List.| Constructor and Description |
|---|
ListEventConsumer() |
ListEventConsumer(java.util.List events)
Constructs an instance that adds events to the provided list.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(javax.xml.stream.events.XMLEvent event)
Adds the event to the internal list.
|
java.util.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(java.util.List events)
Sets the
List to which events will be written. |
public ListEventConsumer()
public ListEventConsumer(java.util.List events)
events - The list to which events will be added, or null.public void add(javax.xml.stream.events.XMLEvent event)
throws javax.xml.stream.XMLStreamException
add in interface javax.xml.stream.util.XMLEventConsumerjavax.xml.stream.XMLStreamExceptionpublic java.util.List getEvents()
List of events added to this consumer.List of events added to this consumer.public void setEvents(java.util.List events)
List to which events will be written.events - The List to which events will be written.public void reset()