Here you can find the source of isJSONValid(String jsonInString)
public static boolean isJSONValid(String jsonInString)
//package com.java2s; import com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException; public class Main { public static boolean isJSONValid(String jsonInString) { try {// w w w . j a v a 2s . c o m final ObjectMapper mapper = new ObjectMapper(); mapper.readTree(jsonInString); return true; } catch (IOException e) { return false; } } }