com.perdues.db.typeHandlers
Class BooleanTypeHandler

java.lang.Object
  |
  +--com.perdues.db.typeHandlers.StringTypeHandler
        |
        +--com.perdues.db.typeHandlers.IntegerTypeHandler
              |
              +--com.perdues.db.typeHandlers.BooleanTypeHandler
All Implemented Interfaces:
DBTypeHandler

public class BooleanTypeHandler
extends IntegerTypeHandler

Booleans are integers with value of 0 or 1. SQL accepts any nonzero value as true, but that is not valid in a form.


Constructor Summary
BooleanTypeHandler()
          Construct a Boolean typeHandler.
 
Method Summary
 java.lang.String renderForSQL(ColumnInfo col, Form form, java.lang.String field)
          Render as a 0 or 1, or null if not present.
 void validate(ColumnInfo col, Form form, java.util.Hashtable errs)
          An integer field must have exactly the specified number of numeric digits, but if the number of digits is unspecified, then any nonzero number will do.
 
Methods inherited from class com.perdues.db.typeHandlers.IntegerTypeHandler
integerValidator
 
Methods inherited from class com.perdues.db.typeHandlers.StringTypeHandler
storeToForm, storeToForm
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BooleanTypeHandler

public BooleanTypeHandler()
Construct a Boolean typeHandler.
Method Detail

renderForSQL

public java.lang.String renderForSQL(ColumnInfo col,
                                     Form form,
                                     java.lang.String field)
Render as a 0 or 1, or null if not present.
Overrides:
renderForSQL in class IntegerTypeHandler

validate

public void validate(ColumnInfo col,
                     Form form,
                     java.util.Hashtable errs)
Description copied from class: IntegerTypeHandler
An integer field must have exactly the specified number of numeric digits, but if the number of digits is unspecified, then any nonzero number will do.
Overrides:
validate in class IntegerTypeHandler