Revision: 4340
          http://sourceforge.net/p/jump-pilot/code/4340
Author:   michaudm
Date:     2015-03-15 22:10:27 +0000 (Sun, 15 Mar 2015)
Log Message:
-----------
Add BigInt, Time and Numeric to jml and shapefile writer to be consistent with 
all types available in the schema editor.

Modified Paths:
--------------
    core/trunk/src/com/vividsolutions/jump/io/GMLInputTemplate.java
    core/trunk/src/com/vividsolutions/jump/io/ShapefileWriter.java

Modified: core/trunk/src/com/vividsolutions/jump/io/GMLInputTemplate.java
===================================================================
--- core/trunk/src/com/vividsolutions/jump/io/GMLInputTemplate.java     
2015-03-15 21:22:03 UTC (rev 4339)
+++ core/trunk/src/com/vividsolutions/jump/io/GMLInputTemplate.java     
2015-03-15 22:10:27 UTC (rev 4340)
@@ -303,7 +303,7 @@
             }
         }
 
-        if (cd.type == AttributeType.LONG) {
+        if (cd.type == AttributeType.LONG || cd.type == AttributeType.BIGINT) {
             try {
                 return Long.parseLong(val);
             } catch (Exception e) {
@@ -314,6 +314,7 @@
         if (cd.type == AttributeType.DOUBLE ||
                 cd.type == AttributeType.REAL ||
                 cd.type == AttributeType.FLOAT ||
+                cd.type == AttributeType.NUMERIC ||
                 cd.type == AttributeType.DECIMAL ||
                 cd.type == AttributeType.BIGDECIMAL) {
             try {
@@ -325,7 +326,9 @@
         
         //Adding date support. Can we throw an exception if an exception
         //occurs or if the type is unrecognized? [Jon Aquino]
-        if (cd.type == AttributeType.DATE || cd.type == 
AttributeType.TIMESTAMP) {
+        if (cd.type == AttributeType.DATE ||
+                cd.type == AttributeType.TIMESTAMP ||
+                cd.type == AttributeType.TIME) {
             try {
                 return dateParser.parse(val, false);
             } catch (Exception e) {

Modified: core/trunk/src/com/vividsolutions/jump/io/ShapefileWriter.java
===================================================================
--- core/trunk/src/com/vividsolutions/jump/io/ShapefileWriter.java      
2015-03-15 21:22:03 UTC (rev 4339)
+++ core/trunk/src/com/vividsolutions/jump/io/ShapefileWriter.java      
2015-03-15 22:10:27 UTC (rev 4340)
@@ -442,7 +442,7 @@
                 if (fromFile.fieldnumdec == 0)
                     fields[f] = fromFile;
                 f++;
-            } else if (columnType == AttributeType.LONG) {
+            } else if (columnType == AttributeType.LONG || columnType == 
AttributeType.BIGINT) {
                 fields[f] = new DbfFieldDef(columnName, 'N', 21, 0);
                 DbfFieldDef fromFile = 
overrideWithExistingCompatibleDbfFieldDef(fields[f], fieldMap);
                 if (fromFile.fieldnumdec == 0)
@@ -451,6 +451,7 @@
             } else if (columnType == AttributeType.DOUBLE ||
                         columnType == AttributeType.REAL ||
                         columnType == AttributeType.FLOAT ||
+                        columnType == AttributeType.NUMERIC ||
                         columnType == AttributeType.DECIMAL ||
                         columnType == AttributeType.BIGDECIMAL) {
                 fields[f] = new DbfFieldDef(columnName, 'N', 33, 16);
@@ -492,7 +493,9 @@
                 fields[f] = new DbfFieldDef(columnName, 'C', maxlength, 0);
                 //fields[f] = 
overrideWithExistingCompatibleDbfFieldDef(fields[f], fieldMap);
                f++;
-            } else if (columnType == AttributeType.DATE || columnType == 
AttributeType.TIMESTAMP) {
+            } else if (columnType == AttributeType.DATE ||
+                    columnType == AttributeType.TIMESTAMP ||
+                    columnType == AttributeType.TIME) {
                 fields[f] = new DbfFieldDef(columnName, 'D', 8, 0);
                 f++;                
             } else if (columnType == AttributeType.BOOLEAN || columnType == 
AttributeType.BIT) {
@@ -567,7 +570,7 @@
                     } else {
                         DBFrow.add(a);
                     }
-                } else if (columnType == AttributeType.LONG) {
+                } else if (columnType == AttributeType.LONG || columnType == 
AttributeType.BIGINT) {
                     Object a = feature.getAttribute(u);
 
                     if (a == null) {
@@ -579,6 +582,7 @@
                         columnType == AttributeType.REAL ||
                         columnType == AttributeType.FLOAT ||
                         columnType == AttributeType.DECIMAL ||
+                        columnType == AttributeType.NUMERIC ||
                         columnType == AttributeType.BIGDECIMAL) {
                     Object a = feature.getAttribute(u);
 
@@ -587,7 +591,9 @@
                     } else {
                         DBFrow.add(a);
                     }
-                } else if (columnType == AttributeType.DATE || columnType == 
AttributeType.TIMESTAMP) {
+                } else if (columnType == AttributeType.DATE ||
+                        columnType == AttributeType.TIMESTAMP ||
+                        columnType == AttributeType.TIME) {
                     Object a = feature.getAttribute(u);
                     if (a == null) {
                         DBFrow.add("");


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to