net.sourceforge.jdbcimporter.columntranslator
Class IntToBooleanColumnTranslator

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

public class IntToBooleanColumnTranslator
extends java.lang.Object
implements ColumnTranslator

The IntToBooleanColumnTranslator translates a column value (default '1') into 'true' and (default '0') into 'false' 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
IntToBooleanColumnTranslator()
           
 
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

IntToBooleanColumnTranslator

public IntToBooleanColumnTranslator()
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)