File: catjson.java

package info (click to toggle)
libcatmandu-fix-cmd-perl 0.0201-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, trixie
  • size: 132 kB
  • sloc: perl: 56; java: 15; ansic: 15; lisp: 8; makefile: 8; python: 6
file content (24 lines) | stat: -rw-r--r-- 699 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*
 * Requires gson:
 *  javac -cp gson-2.2.2.jar catjson.java
 *  java -cp gson-2.2.2.jar:. catjson
 * 
 * Patrick . Hochstenbach @ UGent . be
 */
import java.io.BufferedReader;
import java.io.InputStreamReader;
import com.google.gson.JsonParser;
import com.google.gson.JsonElement;

public class catjson {
    public static void main(String[] args) throws Exception {
         BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in)); 
         JsonParser parser = new JsonParser();
         String line; 
         
         while ((line = stdin.readLine()) != null) {
             JsonElement elem = parser.parse(line);
             System.out.println(elem);
         }
    }
}