olg.csv.base
Class IgnoreNullWriter

java.lang.Object
  extended by olg.csv.base.IgnoreNullWriter
All Implemented Interfaces:
Closeable, IWriter

public class IgnoreNullWriter
extends Object
implements IWriter

A "Proxy" writer which Provides a mecanism to skip empty row.

Author:
Olivier Godineau

Constructor Summary
IgnoreNullWriter(IWriter writer)
           
 
Method Summary
 void addLine(String[] values)
          Write a row only if not empty.
 void addRow(Row row)
          writes a row only if not empty.
 void close()
          Close the original writer.
 boolean isWithHeaders()
          Indicates if the file has a headers line.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IgnoreNullWriter

public IgnoreNullWriter(IWriter writer)
Parameters:
writer - a concret reader
Method Detail

close

public void close()
Close the original writer.

Specified by:
close in interface Closeable

addRow

public void addRow(Row row)
writes a row only if not empty.

Specified by:
addRow in interface IWriter
Parameters:
row - the row.

addLine

public void addLine(String[] values)
Write a row only if not empty.

Specified by:
addLine in interface IWriter
Parameters:
values - the row.

isWithHeaders

public boolean isWithHeaders()
Description copied from interface: IWriter
Indicates if the file has a headers line.

Specified by:
isWithHeaders in interface IWriter
Returns:
the original withHeaders attribute.


Copyright © 2014. All rights reserved.