com.perdues.db.typeHandlers
Class IntegerTypeHandler

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

public class IntegerTypeHandler
extends StringTypeHandler


Constructor Summary
IntegerTypeHandler()
           
IntegerTypeHandler(int digits)
          You can build an Integer type with a specific number of required numeric digits.
 
Method Summary
static java.lang.String integerValidator(java.lang.String numeric, int min)
          Returns a message string if the format is not valid, or null if OK.
 java.lang.String renderForSQL(ColumnInfo col, Form form, java.lang.String field)
          Renders an SQL string literal for the field, or null if it is not present in the Form.
 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.StringTypeHandler
storeToForm, storeToForm
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntegerTypeHandler

public IntegerTypeHandler()

IntegerTypeHandler

public IntegerTypeHandler(int digits)
You can build an Integer type with a specific number of required numeric digits.
Method Detail

renderForSQL

public java.lang.String renderForSQL(ColumnInfo col,
                                     Form form,
                                     java.lang.String field)
Description copied from class: StringTypeHandler
Renders an SQL string literal for the field, or null if it is not present in the Form.
Overrides:
renderForSQL in class StringTypeHandler

validate

public 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.
Overrides:
validate in class StringTypeHandler

integerValidator

public static java.lang.String integerValidator(java.lang.String numeric,
                                                int min)
Returns a message string if the format is not valid, or null if OK. The integer argument is the minimum number of digits.