@Test public void testStartEndElement() throws XMLStreamException { XMLEventReader reader = createXmlEventReader("<alice/>", ACCEPT_ALL); Assert.assertEquals(XMLStreamConstants.START_ELEMENT, reader.nextEvent().getEventType()); Assert.assertEquals(XMLStreamConstants.END_ELEMENT, reader.nextEvent().getEventType()); reader = createXmlEventReader("<alice></alice>", ACCEPT_ALL); Assert.assertEquals(XMLStreamConstants.START_ELEMENT, reader.nextEvent().getEventType()); Assert.assertEquals(XMLStreamConstants.END_ELEMENT, reader.nextEvent().getEventType()); }
@Override public XMLEvent nextEvent() throws XMLStreamException { if (hasNext()) { XMLEvent event = getParent().nextEvent(); currentEventType = event.getEventType(); return event; } throw new XMLStreamException("no more events"); }
SimpleXMLFilteredEventReader extends EventReaderDelegate { @Override public XMLEvent nextEvent() throws XMLStreamException { if (hasNext()) { XMLEvent event = getParent().nextEvent(); currentEventType = event.getEventType(); return event; } throw new XMLStreamException("no more events"); } }
SimpleXMLFilteredEventReader extends EventReaderDelegate { @Override public XMLEvent nextEvent() throws XMLStreamException { if (hasNext()) { XMLEvent event = getParent().nextEvent(); currentEventType = event.getEventType(); return event; } throw new XMLStreamException("no more events"); } SimpleXMLFilteredEventReader(XMLEventReader reader, EventFilter filter); }
SimpleXMLFilteredEventReader extends EventReaderDelegate { @Override public XMLEvent nextEvent() throws XMLStreamException { if (hasNext()) { XMLEvent event = getParent().nextEvent(); currentEventType = event.getEventType(); return event; } throw new XMLStreamException("no more events"); } SimpleXMLFilteredEventReader(XMLEventReader reader, EventFilter filter); @Override void setParent(XMLEventReader reader); @Override boolean hasNext(); @Override XMLEvent peek(); @Override Object next(); @Override XMLEvent nextEvent(); @Override String getElementText(); @Override XMLEvent nextTag(); }
SimpleXMLFilteredEventReader extends EventReaderDelegate { @Override public XMLEvent nextEvent() throws XMLStreamException { if (hasNext()) { XMLEvent event = getParent().nextEvent(); currentEventType = event.getEventType(); return event; } throw new XMLStreamException("no more events"); } SimpleXMLFilteredEventReader(XMLEventReader reader, EventFilter filter); @Override void setParent(XMLEventReader reader); @Override boolean hasNext(); @Override XMLEvent peek(); @Override Object next(); @Override XMLEvent nextEvent(); @Override String getElementText(); @Override XMLEvent nextTag();  }