SMILA (incubation) API documentation

org.eclipse.smila.datamodel.xml
Class StaxRecordReader

java.lang.Object
  extended by org.eclipse.smila.datamodel.xml.StaxRecordReader

public class StaxRecordReader
extends java.lang.Object

StAX based Id reader. Should give better performance than the DOM based IdParser.

Author:
jschumacher

Constructor Summary
StaxRecordReader()
          create default instance.
StaxRecordReader(DataFactory dataFactory)
           
 
Method Summary
 Record readRecord(javax.xml.stream.XMLStreamReader staxReader)
          read Record from the XML stream.
 java.util.List<Record> readRecords(javax.xml.stream.XMLStreamReader staxReader)
          read Record list from the XML stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StaxRecordReader

public StaxRecordReader()
create default instance.


StaxRecordReader

public StaxRecordReader(DataFactory dataFactory)
Parameters:
dataFactory - data factory to use.
Method Detail

readRecords

public java.util.List<Record> readRecords(javax.xml.stream.XMLStreamReader staxReader)
                                   throws javax.xml.stream.XMLStreamException
read Record list from the XML stream. The stream must be currently at the RecordList start tag.

Parameters:
staxReader - source XML stream
Returns:
Record list read from stream or an empty list, if stream is not currently at a RecordList start tag.
Throws:
javax.xml.stream.XMLStreamException - StAX error.

readRecord

public Record readRecord(javax.xml.stream.XMLStreamReader staxReader)
                  throws javax.xml.stream.XMLStreamException
read Record from the XML stream. The stream must be currently at the Record start tag.

Parameters:
staxReader - source XML stream
Returns:
Record read from stream or null, if stream is not currently at a Record start tag.
Throws:
javax.xml.stream.XMLStreamException - StAX error.

SMILA (incubation) API documentation