net.sf.jsefa.rbf.lowlevel
Class RbfLowLevelSerializerImpl<C extends RbfLowLevelConfiguration>

java.lang.Object
  extended by net.sf.jsefa.rbf.lowlevel.RbfLowLevelSerializerImpl<C>
Type Parameters:
C - the type of the RbfLowLevelConfiguration
All Implemented Interfaces:
LowLevelSerializer, RbfLowLevelSerializer
Direct Known Subclasses:
CsvLowLevelSerializerImpl, FlrLowLevelSerializerImpl

public class RbfLowLevelSerializerImpl<C extends RbfLowLevelConfiguration>
extends Object
implements RbfLowLevelSerializer

Abstract implementation of RbfLowLevelSerializer.

Author:
Norman Lahme-Huetig

Constructor Summary
RbfLowLevelSerializerImpl(C config)
          Constructs a new RbfLowLevelSerializerImpl.
 
Method Summary
protected  void afterOpen()
          Called after opening a new input stream.
protected  void beforeFinishRecord()
          Called before a record is finished.
 void close(boolean closeWriter)
          Closes the serialization stream.
 void finishRecord()
          Finishes the current record.
 void flush()
          Flushes the stream.
protected  C getConfiguration()
          Returns the configuration object.
 void open(Writer writer)
          Opens a new serialization stream based on the given writer.
protected  void writeChar(int character)
          Writes the given character to the stream.
 void writeLine(String line)
          Writes the given line.
protected  void writeString(String value)
          Writes the given String value as it is to the stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RbfLowLevelSerializerImpl

public RbfLowLevelSerializerImpl(C config)
Constructs a new RbfLowLevelSerializerImpl.

Parameters:
config - the configuration object
Method Detail

open

public final void open(Writer writer)
Opens a new serialization stream based on the given writer.

Specified by:
open in interface LowLevelSerializer
Parameters:
writer - the writer to base the stream on

finishRecord

public final void finishRecord()
Finishes the current record.

Specified by:
finishRecord in interface RbfLowLevelSerializer

writeLine

public void writeLine(String line)
Writes the given line.

Specified by:
writeLine in interface RbfLowLevelSerializer
Parameters:
line - a line

flush

public void flush()
Flushes the stream.

Specified by:
flush in interface LowLevelSerializer

close

public final void close(boolean closeWriter)
Closes the serialization stream. The underlying writer will be closed only if closeWriter is true, too.

Specified by:
close in interface LowLevelSerializer
Parameters:
closeWriter - if true, the underlying writer will be closed, too.

getConfiguration

protected final C getConfiguration()
Returns the configuration object.

Returns:
the configuration object

afterOpen

protected void afterOpen()
Called after opening a new input stream. Override to perform extra action.


beforeFinishRecord

protected void beforeFinishRecord()
Called before a record is finished. Override to perform extra action.


writeChar

protected final void writeChar(int character)
Writes the given character to the stream.

Parameters:
character - the character.

writeString

protected final void writeString(String value)
Writes the given String value as it is to the stream.

Parameters:
value - the String value.


Copyright © 2014. All rights reserved.