diff options
author | Abyss777 <abyss@fox5.ru> | 2016-09-14 16:31:54 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2016-09-14 16:31:54 +0500 |
commit | 2a14da72f46fb4984713ececc63b2a73954a5782 (patch) | |
tree | 42987bf4a2cc97b7eaf71fe6c908f7d690fa068d /src | |
parent | 5a3cad30d5b2fa5a4be6cba0eed6df135f496165 (diff) | |
download | trackermap-server-2a14da72f46fb4984713ececc63b2a73954a5782.tar.gz trackermap-server-2a14da72f46fb4984713ececc63b2a73954a5782.tar.bz2 trackermap-server-2a14da72f46fb4984713ececc63b2a73954a5782.zip |
- Make Attributes always last column
- Format Map as simple string instead of json
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/web/CsvBuilder.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/org/traccar/web/CsvBuilder.java b/src/org/traccar/web/CsvBuilder.java index 73d5fac1d..cd0f36fc4 100644 --- a/src/org/traccar/web/CsvBuilder.java +++ b/src/org/traccar/web/CsvBuilder.java @@ -37,6 +37,12 @@ public class CsvBuilder { SortedSet<Method> methods = new TreeSet<Method>(new Comparator<Method>() { @Override public int compare(Method m1, Method m2) { + if (m1.getName().equals("getAttributes") & !m1.getName().equals(m2.getName())) { + return 1; + } + if (m2.getName().equals("getAttributes") & !m1.getName().equals(m2.getName())) { + return -1; + } return m1.getName().compareTo(m2.getName()); } }); @@ -73,7 +79,10 @@ public class CsvBuilder { } else if (method.getReturnType().equals(Map.class)) { Map value = (Map) method.invoke(object); if (value != null) { - builder.append(MiscFormatter.toJson(value).toString()); + String map = MiscFormatter.toJson(value).toString(); + map = map.replaceAll("[\\{|\\}|\"]", ""); + map = map.replaceAll(",", " "); + builder.append(map); addSeparator(); } } |