SMILA (incubation) API documentation

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

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

public class RecordWriter
extends java.lang.Object

StAX based Id writer. Should give better performance than the DOM based IdBuilder.

Author:
jschumacher

Constructor Summary
RecordWriter()
          create default instance.
RecordWriter(boolean printPretty)
           
 
Method Summary
protected static java.lang.String cleanText(java.lang.String text)
           
 void writeRecord(javax.xml.stream.XMLStreamWriter staxWriter, Record record)
          Append a rec:Record element describing the given record to the given XML stream.
 void writeRecordList(javax.xml.stream.XMLStreamWriter staxWriter, java.lang.Iterable<Record> records)
          Append a rec:RecordList element describing the given record list to the given XML stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RecordWriter

public RecordWriter()
create default instance.


RecordWriter

public RecordWriter(boolean printPretty)
Parameters:
printPretty - set to true to add newlines after each element tag.
Method Detail

writeRecord

public void writeRecord(javax.xml.stream.XMLStreamWriter staxWriter,
                        Record record)
                 throws javax.xml.stream.XMLStreamException
Append a rec:Record element describing the given record to the given XML stream. The element contains a namespace declaration for xmlns:rec.

Parameters:
staxWriter - target XML stream
record - the record to write
Throws:
javax.xml.stream.XMLStreamException - StAX error

writeRecordList

public void writeRecordList(javax.xml.stream.XMLStreamWriter staxWriter,
                            java.lang.Iterable<Record> records)
                     throws javax.xml.stream.XMLStreamException
Append a rec:RecordList element describing the given record list to the given XML stream. The element contains a namespace declaration for xmlns:rec.

Parameters:
staxWriter - target XML stream
records - the record list to transform.
Throws:
javax.xml.stream.XMLStreamException - StAX error

cleanText

protected static java.lang.String cleanText(java.lang.String text)
Parameters:
text - input text (XML)
Returns:
XML text cleaned from characters forbidden in XML 1.1 specification

SMILA (incubation) API documentation