Class DefaultFragmentEventReader
java.lang.Object
org.springframework.batch.item.xml.stax.DefaultFragmentEventReader
- All Implemented Interfaces:
Iterator<Object>
,XMLEventReader
,FragmentEventReader
Default implementation of
FragmentEventReader
- Author:
- Robert Kasanicky
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDefaultFragmentEventReader
(XMLEventReader wrappedEventReader) Caches the StartDocument event for later use. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
getProperty
(String name) boolean
hasNext()
void
Finishes reading the fragment in case the fragment was processed without being read until the end.void
Tells the event reader its cursor position is exactly before the fragment.next()
nextTag()
peek()
void
remove()
void
reset()
Reset the state of the fragment reader - make it forget it assumptions about current position of cursor (e.g.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
Methods inherited from interface javax.xml.stream.XMLEventReader
close, getElementText, getProperty, nextTag
-
Field Details
-
wrappedEventReader
-
-
Constructor Details
-
DefaultFragmentEventReader
Caches the StartDocument event for later use.- Parameters:
wrappedEventReader
- the original wrapped event reader
-
-
Method Details
-
markStartFragment
public void markStartFragment()Description copied from interface:FragmentEventReader
Tells the event reader its cursor position is exactly before the fragment.- Specified by:
markStartFragment
in interfaceFragmentEventReader
-
hasNext
public boolean hasNext()- Specified by:
hasNext
in interfaceIterator<Object>
- Specified by:
hasNext
in interfaceXMLEventReader
-
next
-
nextEvent
- Specified by:
nextEvent
in interfaceXMLEventReader
- Throws:
XMLStreamException
-
peek
- Specified by:
peek
in interfaceXMLEventReader
- Throws:
XMLStreamException
-
markFragmentProcessed
public void markFragmentProcessed()Finishes reading the fragment in case the fragment was processed without being read until the end.- Specified by:
markFragmentProcessed
in interfaceFragmentEventReader
-
reset
public void reset()Description copied from interface:FragmentEventReader
Reset the state of the fragment reader - make it forget it assumptions about current position of cursor (e.g. in case of rollback of the wrapped reader).- Specified by:
reset
in interfaceFragmentEventReader
-
close
- Specified by:
close
in interfaceXMLEventReader
- Throws:
XMLStreamException
-
getElementText
- Specified by:
getElementText
in interfaceXMLEventReader
- Throws:
XMLStreamException
-
getProperty
- Specified by:
getProperty
in interfaceXMLEventReader
- Throws:
IllegalArgumentException
-
nextTag
- Specified by:
nextTag
in interfaceXMLEventReader
- Throws:
XMLStreamException
-
remove
public void remove()
-