net.sourceforge.jdbcimporter.columntranslator
Class BooleanToIntColumnTranslator

java.lang.Object
  extended bynet.sourceforge.jdbcimporter.columntranslator.BooleanToIntColumnTranslator
All Implemented Interfaces:
ColumnTranslator

public class BooleanToIntColumnTranslator
extends java.lang.Object
implements ColumnTranslator

The BooleanToIntColumnTranslator translates a column value of 'true' into an integer (default '1') and 'false' into an integer (default '0') if the column is of type 'BOOLEAN'.

Version:
0.62
Author:
Chris Nagy

Field Summary
protected  int falseValue
          The integer representing the column value 'false'.
protected  int trueValue
          The integer representing the column value 'true'.
 
Constructor Summary
BooleanToIntColumnTranslator()
           
 
Method Summary
 ColumnValue getValue(ColumnDef column, ColumnValue columnValue)
          Returns the translated column value.
 void setFalseValue(int newVal)
          Sets the integer value representing 'false'.
 void setTrueValue(int newVal)
          Sets the integer value representing 'true'.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

trueValue

protected int trueValue
The integer representing the column value 'true'.


falseValue

protected int falseValue
The integer representing the column value 'false'.

Constructor Detail

BooleanToIntColumnTranslator

public BooleanToIntColumnTranslator()
Method Detail

setTrueValue

public void setTrueValue(int newVal)
Sets the integer value representing 'true'.

Parameters:
newVal - the integer value

setFalseValue

public void setFalseValue(int newVal)
Sets the integer value representing 'false'.

Parameters:
newVal - the integer value

getValue

public ColumnValue getValue(ColumnDef column,
                            ColumnValue columnValue)
Description copied from interface: ColumnTranslator
Returns the translated column value.

Specified by:
getValue in interface ColumnTranslator
Parameters:
column - the definition of the column
columnValue - the value of the column read from a file
Returns:
the new value of the column
See Also:
ColumnTranslator.getValue(net.sourceforge.jdbcimporter.ColumnDef, net.sourceforge.jdbcimporter.ColumnValue)