I am having some trouble building a class which will parse out gson as I expect it to.
I created a class.
public class JsonObjectBreakDown {
public String type;
public List<String> coordinates = new ArrayList<String>();
}
And called
JsonObjectBreakDown p = gson.fromJson(withDup, JsonObjectBreakDown.class);
Below is my json
{
"type":"Polygon",
"coordinates":[
[
[
-66.9,
18.05
],
[
-66.9,
18.05
],
[
-66.9,
18.06
],
[
-66.9,
18.05
]
]
]
}
I have used gson before successfully, but never with an array like this. Should I not be using the List/ArrayList?
I get the error message;
Exception in thread "main" com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated object at line 1 column 31
OpenCSV code
CSVReader reader = new CSVReader(new FileReader("c:\\Json.csv"));
String tmp = reader.readNext();
CustomObject tmpObj = CustomObject(tmp[0], tmp[1],......);