01 package javax.xml.stream.util;
02
03 import javax.xml.stream.events.XMLEvent;
04 import javax.xml.stream.XMLStreamException;
05
06 /**
07 * This interface defines an event consumer interface. The contract of the
08 * of a consumer is to accept the event. This interface can be used to
09 * mark an object as able to receive events. Add may be called several
10 * times in immediate succession so a consumer must be able to cache
11 * events it hasn't processed yet.
12 *
13 * @version 1.0
14 * @author Copyright (c) 2003 by BEA Systems. All Rights Reserved.
15 * @since 1.6
16 */
17 public interface XMLEventConsumer {
18
19 /**
20 * This method adds an event to the consumer. Calling this method
21 * invalidates the event parameter. The client application should
22 * discard all references to this event upon calling add.
23 * The behavior of an application that continues to use such references
24 * is undefined.
25 *
26 * @param event the event to add, may not be null
27 */
28 public void add(XMLEvent event) throws XMLStreamException;
29 }
|