Note that there are some explanatory texts on larger screens.

plurals
  1. PORecursively parsing a json file using Jackson Json parser
    primarykey
    data
    text
    <p>I'm trying to recursively parse a sample Json file that has many sets of complex elements. And the code that i'm trying is this : </p> <pre><code>public class Jsonex { public static void main(String argv[]) { try { Jsonex jsonExample = new Jsonex(); jsonExample.testJackson(); } catch (Exception e){ System.out.println("Exception " + e); } } public static void testJackson() throws IOException { JsonFactory factory = new JsonFactory(); // System.out.println("hello"); ObjectMapper mapper = new ObjectMapper(factory); File from = new File("D://albumList.txt"); TypeReference&lt;HashMap&lt;String,Object&gt;&gt; typeRef = new TypeReference&lt;HashMap&lt;String,Object&gt;&gt;() {}; HashMap&lt;String,Object&gt; o= mapper.readValue(from, typeRef); // System.out.println("" + o); Iterator it = o.entrySet().iterator(); while (it.hasNext()) { Map.Entry pairs = (Map.Entry)it.next(); System.out.println(pairs.getKey() + " = " + pairs.getValue()); HashMap&lt;String,Object&gt; o1=mapper.readValue(pairs.getValue().toString(),typeRef); System.out.println("hey"+o1); Iterator it1 = o1.entrySet().iterator(); while (it1.hasNext()) { Map.Entry pairs1 = (Map.Entry)it.next(); System.out.println(pairs1.getKey() + " = " + pairs1.getValue()); it1.remove(); // avoids a ConcurrentModificat } } }} </code></pre> <p>and i get this exception : </p> <p>Exception org.codehaus.jackson.JsonParseException: Unexpected character ('i' (code 105)): was expecting double-quote to start field name at [Source: java.io.StringReader@2de7753a; line: 1, column: 3]</p> <p><strong>Actually what im trying to do is, parse the file and get list of name object pairs, and take the object which inturn has name-object pairs. - but the problem is that the parser is expecting "" before strings !</strong></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload