public class NdmWriter extends Object
Constructor and Description |
---|
NdmWriter(WriterBuilder builder)
Simple constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
writeComment(Generator generator,
String comment)
Write a comment line.
|
<H extends Header,S extends Segment<?,?>,F extends NdmConstituent<H,S>> |
writeConstituent(Generator generator,
F constituent)
Write a constituent.
|
void |
writeMessage(Generator generator,
Ndm message)
Write one complete message.
|
public NdmWriter(WriterBuilder builder)
Calling this constructor directly is not recommended. Users should rather use
WriterBuilder.buildNdmWriter()
.
builder
- builder for the constituents parserspublic void writeMessage(Generator generator, Ndm message) throws IOException
generator
- generator to use for producing outputmessage
- message to writeIOException
- if the stream cannot write to streampublic void writeComment(Generator generator, String comment) throws IOException
Comments allows comments only before constituents, so attempting to add comments after the first constituent has been written will produce an exception.
generator
- generator to use for producing outputcomment
- comment line to writeIOException
- if the stream cannot write to streampublic <H extends Header,S extends Segment<?,?>,F extends NdmConstituent<H,S>> void writeConstituent(Generator generator, F constituent) throws IOException
H
- type of the headerS
- type of the segmentsF
- type of the filegenerator
- generator to use for producing outputconstituent
- constituentIOException
- if the stream cannot write to streamCopyright © 2002-2021 CS GROUP. All rights reserved.