@Override protected void endDocumentInternal() throws XMLStreamException { this.eventWriter.add(this.eventFactory.createEndDocument()); }
@Override protected void endDocumentInternal() throws XMLStreamException { this.eventWriter.add(this.eventFactory.createEndDocument()); }
@Override public void writeEndDocument() throws XMLStreamException { closeEmptyElementIfNecessary(); this.eventWriter.add(this.eventFactory.createEndDocument()); }
@Override public void writeEndDocument() throws XMLStreamException { closeEmptyElementIfNecessary(); this.eventWriter.add(this.eventFactory.createEndDocument()); }
public void endDocument(boolean fragment) throws IOException, SAXException, XMLStreamException { if(!fragment) { out.add(ef.createEndDocument()); out.flush(); } super.endDocument(fragment); }
/** * Caches the StartDocument event for later use. * @param wrappedEventReader the original wrapped event reader */ public DefaultFragmentEventReader(XMLEventReader wrappedEventReader) { super(wrappedEventReader); try { startDocumentEvent = (StartDocument) wrappedEventReader.peek(); } catch (XMLStreamException e) { throw new DataAccessResourceFailureException("Error reading start document from event reader", e); } endDocumentEvent = XMLEventFactory.newInstance().createEndDocument(); }
/** * Constructs a STAX {@link EndDocument}event from a DOM4J {@link * Document}. * * @param doc * The {@link Document}from which to construct the event. * * @return The constructed {@link EndDocument}event. */ public EndDocument createEndDocument(Document doc) { return factory.createEndDocument(); }
@Override public void marshal(Object graph, Result result) throws XmlMappingException, IOException { Assert.isInstanceOf(Result.class, result); try { XMLEventFactory factory = XMLEventFactory.newInstance(); XMLEventWriter writer = StaxTestUtils.getXmlEventWriter(result); writer.add(factory.createStartDocument("UTF-8")); writer.add(factory.createStartElement("prefix", "namespace", graph.toString())); writer.add(factory.createEndElement("prefix", "namespace", graph.toString())); writer.add(factory.createEndDocument()); } catch ( Exception e) { throw new RuntimeException("Exception while writing to output file", e); } }
/** * StartDocument and EndDocument events are not passed to the wrapped * writer. */ public void testNoStartEnd() throws Exception { XMLEvent event = eventFactory.createComment("testEvent"); // mock expects only a single event wrappedWriter.add(event); writer.add(eventFactory.createStartDocument()); writer.add(event); writer.add(eventFactory.createEndDocument()); }
@Override protected void endDocumentInternal() throws XMLStreamException { consumeEvent(eventFactory.createEndDocument()); }
public void writeEndDocument() throws XMLStreamException { eventWriter.add(eventFactory.createEndDocument()); }
public void endDocument(boolean fragment) throws IOException, SAXException, XMLStreamException { if(!fragment) { out.add(ef.createEndDocument()); out.flush(); } super.endDocument(fragment); }
/** * Constructs a STAX {@link EndDocument}event from a DOM4J {@link * Document}. * * @param doc * The {@link Document}from which to construct the event. * * @return The constructed {@link EndDocument}event. */ public EndDocument createEndDocument(Document doc) { return factory.createEndDocument(); }
/** * Creates and adds an {@link EndDocument} event. * * @see XMLEventFactory#createEndDocument() * @throws XMLStreamException If an error occurs adding the event. */ public void addEndDocument() throws XMLStreamException { add(factory.createEndDocument()); }
@Override public void endDocument() throws SAXException { try { // writes the end of document xmlEventWriter.add(eventFactory.createEndDocument()); } catch (XMLStreamException e) { convertToSAXException("Error occurred when writing document end.", e); } }
@Override public void endDocument() throws SAXException { this.eventFactory.setLocation(this.getCurrentLocation()); try { this.consumer.add(this.eventFactory.createEndDocument()); } catch (XMLStreamException e) { throw new SAXException(e); } this.namespaces = null; // clear the namespaces this.namespaceStack.clear(); }
out.add(eventfactory.createEndDocument());
public void endDocument() throws SAXException { eventFactory.setLocation(getCurrentLocation()); try { writer.add(eventFactory.createEndDocument()); } catch (XMLStreamException e) { throw new SAXException(e); } super.endDocument(); // clear the namespaces namespaceStack.clear(); }
public void endDocument() throws SAXException { eventFactory.setLocation(getCurrentLocation()); try { consumer.add(eventFactory.createEndDocument()); } catch (XMLStreamException e) { throw new SAXException(e); } super.endDocument(); // clear the namespaces namespaceStack.clear(); }
public void endDocument(boolean fragment) throws IOException, SAXException, XMLStreamException { if(!fragment) { out.add(ef.createEndDocument()); out.flush(); } super.endDocument(fragment); }