SMILA (incubation) API documentation

org.eclipse.smila.datamodel.record.stax
Class RecordReader

java.lang.Object
  extended by org.eclipse.smila.datamodel.record.stax.RecordReader

public class RecordReader
extends java.lang.Object

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

Author:
jschumacher

Constructor Summary
RecordReader()
          create default instance.
RecordReader(RecordFactory recordFactory, IdFactory idFactory)
           
 
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

RecordReader

public RecordReader()
create default instance.


RecordReader

public RecordReader(RecordFactory recordFactory,
                    IdFactory idFactory)
Parameters:
recordFactory - record factory to use.
idFactory - Id 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