org.springframework.batch.item.xml.stax
Class DefaultFragmentEventReader

java.lang.Object
  extended by org.springframework.batch.item.xml.stax.DefaultFragmentEventReader
All Implemented Interfaces:
Iterator, javax.xml.stream.XMLEventReader, FragmentEventReader

public class DefaultFragmentEventReader
extends Object
implements FragmentEventReader

Default implementation of FragmentEventReader

Author:
Robert Kasanicky

Field Summary
protected  javax.xml.stream.XMLEventReader wrappedEventReader
           
 
Constructor Summary
DefaultFragmentEventReader(javax.xml.stream.XMLEventReader wrappedEventReader)
          Caches the StartDocument event for later use.
 
Method Summary
 void close()
           
 String getElementText()
           
 Object getProperty(String name)
           
 boolean hasNext()
           
 void markFragmentProcessed()
          Finishes reading the fragment in case the fragment was processed without being read until the end.
 void markStartFragment()
          Tells the event reader its cursor position is exactly before the fragment.
 Object next()
           
 javax.xml.stream.events.XMLEvent nextEvent()
           
 javax.xml.stream.events.XMLEvent nextTag()
           
 javax.xml.stream.events.XMLEvent 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 javax.xml.stream.XMLEventReader
close, getElementText, getProperty, nextTag
 
Methods inherited from interface java.util.Iterator
remove
 

Field Detail

wrappedEventReader

protected javax.xml.stream.XMLEventReader wrappedEventReader
Constructor Detail

DefaultFragmentEventReader

public DefaultFragmentEventReader(javax.xml.stream.XMLEventReader wrappedEventReader)
Caches the StartDocument event for later use.

Parameters:
wrappedEventReader - the original wrapped event reader
Method Detail

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 interface FragmentEventReader

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator
Specified by:
hasNext in interface javax.xml.stream.XMLEventReader

next

public Object next()
Specified by:
next in interface Iterator

nextEvent

public javax.xml.stream.events.XMLEvent nextEvent()
                                           throws javax.xml.stream.XMLStreamException
Specified by:
nextEvent in interface javax.xml.stream.XMLEventReader
Throws:
javax.xml.stream.XMLStreamException

peek

public javax.xml.stream.events.XMLEvent peek()
                                      throws javax.xml.stream.XMLStreamException
Specified by:
peek in interface javax.xml.stream.XMLEventReader
Throws:
javax.xml.stream.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 interface FragmentEventReader

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 interface FragmentEventReader

close

public void close()
           throws javax.xml.stream.XMLStreamException
Specified by:
close in interface javax.xml.stream.XMLEventReader
Throws:
javax.xml.stream.XMLStreamException

getElementText

public String getElementText()
                      throws javax.xml.stream.XMLStreamException
Specified by:
getElementText in interface javax.xml.stream.XMLEventReader
Throws:
javax.xml.stream.XMLStreamException

getProperty

public Object getProperty(String name)
                   throws IllegalArgumentException
Specified by:
getProperty in interface javax.xml.stream.XMLEventReader
Throws:
IllegalArgumentException

nextTag

public javax.xml.stream.events.XMLEvent nextTag()
                                         throws javax.xml.stream.XMLStreamException
Specified by:
nextTag in interface javax.xml.stream.XMLEventReader
Throws:
javax.xml.stream.XMLStreamException

remove

public void remove()
Specified by:
remove in interface Iterator


Copyright © 2009 SpringSource. All Rights Reserved.