01: //==============================================================================
02: //===
03: //=== Import (adapted class from druid project http://druid.sf.net)
04: //===
05: //=== Copyright (C) by Andrea Carboni.
06: //=== This file may be distributed under the terms of the GPL license.
07: //==============================================================================
08:
09: package org.fao.gast.lib.druid;
10:
11: //==============================================================================
12:
13: public class ImportField {
14: public String name;
15: public String type;
16: public SqlType sqlType;
17:
18: //---------------------------------------------------------------------------
19:
20: ImportField(String line) {
21: int idx = line.indexOf(",");
22:
23: if (idx == -1)
24: throw new IllegalArgumentException("Bad field format");
25:
26: name = line.substring(0, idx).trim();
27: type = line.substring(idx + 1).trim();
28: sqlType = SqlMapper.mapName(type);
29:
30: if (!type.equals(sqlType.sName))
31: throw new IllegalArgumentException("Field types differ");
32: }
33:
34: //---------------------------------------------------------------------------
35:
36: public String toString() {
37: return name;
38: }
39: }
40:
41: //==============================================================================
|