aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/web/CsvBuilder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-12-19 08:01:20 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-12-19 08:01:20 +1300
commit54e738d3281a463a0ea3fcf2026c2464529a9b58 (patch)
tree65e924f480d6489a5939d2f289c354240fd68e59 /src/org/traccar/web/CsvBuilder.java
parent99f09134fb9c710114296d603c97a76f5cfb0d2a (diff)
downloadtrackermap-server-54e738d3281a463a0ea3fcf2026c2464529a9b58.tar.gz
trackermap-server-54e738d3281a463a0ea3fcf2026c2464529a9b58.tar.bz2
trackermap-server-54e738d3281a463a0ea3fcf2026c2464529a9b58.zip
Remove own JSON converter
Diffstat (limited to 'src/org/traccar/web/CsvBuilder.java')
-rw-r--r--src/org/traccar/web/CsvBuilder.java17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/org/traccar/web/CsvBuilder.java b/src/org/traccar/web/CsvBuilder.java
index 532f06e3d..31b389873 100644
--- a/src/org/traccar/web/CsvBuilder.java
+++ b/src/org/traccar/web/CsvBuilder.java
@@ -27,11 +27,12 @@ import java.util.Map;
import java.util.SortedSet;
import java.util.TreeSet;
+import com.fasterxml.jackson.core.JsonProcessingException;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.ISODateTimeFormat;
+import org.traccar.Context;
import org.traccar.helper.Log;
-import org.traccar.model.MiscFormatter;
public class CsvBuilder {
@@ -95,11 +96,15 @@ public class CsvBuilder {
} else if (method.getReturnType().equals(Map.class)) {
Map value = (Map) method.invoke(object);
if (value != null) {
- String map = MiscFormatter.toJson(value).toString();
- map = map.replaceAll("[\\{\\}\"]", "");
- map = map.replaceAll(",", " ");
- builder.append(map);
- addSeparator();
+ try {
+ String map = Context.getObjectMapper().writeValueAsString(value);
+ map = map.replaceAll("[\\{\\}\"]", "");
+ map = map.replaceAll(",", " ");
+ builder.append(map);
+ addSeparator();
+ } catch (JsonProcessingException e) {
+ Log.warning(e);
+ }
}
}
} catch (IllegalAccessException | InvocationTargetException error) {