List of usage examples for org.springframework.util.xml StaxUtils createStaxSource
public static Source createStaxSource(XMLEventReader eventReader) throws XMLStreamException
From source file:org.emonocot.job.io.StaxEventItemReader.java
/** * Move to next fragment and map it to item. * @return an item//w ww . ja va2 s . c om * @throws Exception if there is a problem reading from the resource */ protected final T doRead() throws Exception { if (noInput) { return null; } T item = null; if (moveCursorToNextFragment(fragmentReader)) { fragmentReader.markStartFragment(); @SuppressWarnings("unchecked") T mappedFragment = (T) unmarshaller.unmarshal(StaxUtils.createStaxSource(fragmentReader)); item = mappedFragment; fragmentReader.markFragmentProcessed(); } return item; }