Code example for JsonParser

Methods: parse

0
        String json = parseJsonFileAsString(fileName);
        return parseJsonString(json);
    } 
 
    public static JsonElement parseJsonString(String json) {
        JsonParser parser = new JsonParser();
        return parser.parse(json);
    } 
 
    public static String parseJsonFileAsString(String fileName) throws IOException {
        ClassPathResource resource = new ClassPathResource(fileName);
        String read = IOUtils.toString(resource.getInputStream());
        resource.getInputStream().close();
        return read;
    } 
 
} 
Contextual code suggestions in your IDE  Get Codota for Java