01: package com.salmonllc.jsp.controller;
02:
03: /////////////////////////
04: //$Archive: /JADE/SourceCode/com/salmonllc/jsp/controller/DataBinder.java $
05: //$Author: Srufle $
06: //$Revision: 7 $
07: //$Modtime: 7/31/02 6:11p $
08: /////////////////////////
09: import com.salmonllc.sql.DataStore;
10:
11: /**
12: * Base class for all type of Binders.
13: * Creation date: (8/1/01 11:15:04 AM)
14: * @author: Deepak Agarwal
15: */
16: public class DataBinder {
17: /**
18: * DataBinder constructor comment.
19: */
20: public DataBinder() {
21: super ();
22: }
23:
24: /**
25: * Creation date: (8/1/01 11:09:17 AM)
26: * @return int
27: * @param strDataType java.lang.String
28: */
29: protected int mapDataType(String strDataType) {
30:
31: if (strDataType == null)
32: return 0;
33: else if (strDataType.equalsIgnoreCase("String"))
34: return DataStore.DATATYPE_STRING;
35: else if (strDataType.equalsIgnoreCase("Integer")
36: || strDataType.equalsIgnoreCase("int"))
37: return DataStore.DATATYPE_INT;
38: else if (strDataType.equalsIgnoreCase("Datetime"))
39: return DataStore.DATATYPE_DATETIME;
40: else if (strDataType.equalsIgnoreCase("double"))
41: return DataStore.DATATYPE_DOUBLE;
42: else if (strDataType.equalsIgnoreCase("bytearray"))
43: return DataStore.DATATYPE_BYTEARRAY;
44: else if (strDataType.equalsIgnoreCase("short"))
45: return DataStore.DATATYPE_SHORT;
46: else if (strDataType.equalsIgnoreCase("long"))
47: return DataStore.DATATYPE_LONG;
48: else if (strDataType.equalsIgnoreCase("float"))
49: return DataStore.DATATYPE_FLOAT;
50: else if (strDataType.equalsIgnoreCase("date"))
51: return DataStore.DATATYPE_DATE;
52: else if (strDataType.equalsIgnoreCase("time"))
53: return DataStore.DATATYPE_TIME;
54:
55: return 99;
56: /*
57: DATATYPE_STRING = 0;
58: DATATYPE_INT = 1;
59: DATATYPE_DATETIME = 2;
60: public static final int DATATYPE_DOUBLE = 3;
61: public static final int DATATYPE_BYTEARRAY = 4;
62: public static final int DATATYPE_SHORT = 5;
63: public static final int DATATYPE_LONG = 6;
64: public static final int DATATYPE_FLOAT = 7;
65: public static final int DATATYPE_DATE = 8;
66: public static final int DATATYPE_TIME = 9;
67: protected static final int DATATYPE_ANY = 99;
68: */
69: }
70: }
|