olg.csv.bean.impl
Class RowProcessor<B>

Package class diagram package RowProcessor
java.lang.Object
  extended by olg.csv.bean.impl.RowProcessor<B>
Type Parameters:
B - dedicated bean the processor used.
All Implemented Interfaces:
IRowProcessor<B>

public final class RowProcessor<B>
extends Object
implements IRowProcessor<B>

IRowProcessor implementation.


Nested Class Summary
private  class RowProcessor.ValueStrategy
          Strategy to define a cell value.
 
Field Summary
private  List<CellProcessor<B>> fieldFormatters
          A rowProcessor has a list of columnFormatter.
private  RowProcessor.ValueStrategy headerStrategy
          Strategy to show headers.
private  int nextRowNum
          num of the next row to write.
private  RowProcessor.ValueStrategy valueStrategy
          Strategy to show values.
 
Constructor Summary
RowProcessor(List<CellProcessor<B>> fieldFormatters)
           
 
Method Summary
 Row getHeaders()
          Returns an headers row.
 Row transform(B element)
          Returns a new Row from a bean.
private  Row transform(B element, RowProcessor.ValueStrategy strategy)
          Returns new Row from an element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nextRowNum

private int nextRowNum
num of the next row to write.


valueStrategy

private final RowProcessor.ValueStrategy valueStrategy
Strategy to show values.


headerStrategy

private final RowProcessor.ValueStrategy headerStrategy
Strategy to show headers.


fieldFormatters

private final List<CellProcessor<B>> fieldFormatters
A rowProcessor has a list of columnFormatter. Each of them converts a string into a property of the bean this transformer must return.

Constructor Detail

RowProcessor

public RowProcessor(List<CellProcessor<B>> fieldFormatters)
Parameters:
fieldFormatters - the list of columnFormatter. Each of them converts a string into a property of the bean this processor must return.
Method Detail

transform

public Row transform(B element)
Returns a new Row from a bean.

Specified by:
transform in interface IRowProcessor<B>
Parameters:
element - the bean.
Returns:
a new row.

getHeaders

public Row getHeaders()
Returns an headers row.

Specified by:
getHeaders in interface IRowProcessor<B>
Returns:
headers

transform

private Row transform(B element,
                      RowProcessor.ValueStrategy strategy)
Returns new Row from an element.

Parameters:
element - the element.
strategy - the strategy to set the cell values.
Returns:
a new row.


Copyright © 2014. All Rights Reserved.