diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-05-03 12:09:00 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-05-03 12:09:00 +1200 |
commit | 18127a2dfc362ffd7de4110e013a10a9f894469b (patch) | |
tree | 24ced00567acbc751985b71ffd99ce067213a34d /src/org/traccar/database/QueryBuilder.java | |
parent | 427113e0aabf1b8ab54288263c3e809f292a5a05 (diff) | |
download | trackermap-server-18127a2dfc362ffd7de4110e013a10a9f894469b.tar.gz trackermap-server-18127a2dfc362ffd7de4110e013a10a9f894469b.tar.bz2 trackermap-server-18127a2dfc362ffd7de4110e013a10a9f894469b.zip |
Implmenet reflection json conversion
Diffstat (limited to 'src/org/traccar/database/QueryBuilder.java')
-rw-r--r-- | src/org/traccar/database/QueryBuilder.java | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/org/traccar/database/QueryBuilder.java b/src/org/traccar/database/QueryBuilder.java index 29a737f20..d05f48c09 100644 --- a/src/org/traccar/database/QueryBuilder.java +++ b/src/org/traccar/database/QueryBuilder.java @@ -15,7 +15,6 @@ */ package org.traccar.database; -import java.beans.Introspector; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.sql.PreparedStatement; @@ -176,17 +175,17 @@ public class QueryBuilder { String name = method.getName().substring(3); try { if (method.getReturnType().equals(boolean.class)) { - return setBoolean(name, (Boolean) method.invoke(object)); + setBoolean(name, (Boolean) method.invoke(object)); } else if (method.getReturnType().equals(int.class)) { - return setInteger(name, (Integer) method.invoke(object)); + setInteger(name, (Integer) method.invoke(object)); } else if (method.getReturnType().equals(long.class)) { - return setLong(name, (Long) method.invoke(object)); + setLong(name, (Long) method.invoke(object)); } else if (method.getReturnType().equals(double.class)) { - return setDouble(name, (Double) method.invoke(object)); + setDouble(name, (Double) method.invoke(object)); } else if (method.getReturnType().equals(String.class)) { - return setString(name, (String) method.invoke(object)); + setString(name, (String) method.invoke(object)); } else if (method.getReturnType().equals(Date.class)) { - return setDate(name, (Date) method.invoke(object)); + setDate(name, (Date) method.invoke(object)); } } catch (IllegalAccessException error) { } catch (InvocationTargetException error) { |