com.perdues.db.typeHandlers
Class NumericTypeHandler

java.lang.Object
  |
  +--com.perdues.db.typeHandlers.StringTypeHandler
        |
        +--com.perdues.db.typeHandlers.NumericTypeHandler
All Implemented Interfaces:
DBTypeHandler
Direct Known Subclasses:
IDTypeHandler, PhoneACTypeHandler, ZipcodeTypeHandler

public class NumericTypeHandler
extends StringTypeHandler
implements DBTypeHandler


Constructor Summary
NumericTypeHandler()
           
NumericTypeHandler(int digits)
          You can build a Numeric type with a specific number of required digits.
 
Method Summary
static java.lang.String numericValidator(java.lang.String numeric, int min)
          Returns a message string if the format is not valid, or null if OK.
 void validate(ColumnInfo col, Form form, java.util.Hashtable errs)
          A numeric field must have exactly the specified number of digits, but if the number of digits is unspecified, then any nonzero number will do.
 
Methods inherited from class com.perdues.db.typeHandlers.StringTypeHandler
renderForSQL, storeToForm, storeToForm
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.perdues.db.DBTypeHandler
renderForSQL, storeToForm, storeToForm
 

Constructor Detail

NumericTypeHandler

public NumericTypeHandler()

NumericTypeHandler

public NumericTypeHandler(int digits)
You can build a Numeric type with a specific number of required digits.
Method Detail

validate

public void validate(ColumnInfo col,
                     Form form,
                     java.util.Hashtable errs)
A numeric field must have exactly the specified number of digits, but if the number of digits is unspecified, then any nonzero number will do.
Specified by:
validate in interface DBTypeHandler
Overrides:
validate in class StringTypeHandler

numericValidator

public static java.lang.String numericValidator(java.lang.String numeric,
                                                int min)
Returns a message string if the format is not valid, or null if OK. The string must contain at least "min" characters, all numeric.