title: JSON checker to avoid com.google.gson.stream.MalformedJsonException
body: <p>I'm getting many JSON objects through a web service and at times the json object is malformed.</p>
  
  <p>I wanted to check the if the json is valid before processing it.</p>
  
  <p>So i worte</p>
  
  <pre><code>JsonElement jsonData = parser.parse(attacheddataattribute);
  if(jsonData.isJsonObject()) 
                  {
  //then only process
  }
  </code></pre>
  
  <p>Not also its throwing a
      com.google.gson.stream.MalformedJsonException: Unterminated string at line 1 column 8432 at the parse method.</p>
  
  <p>Is there any implemenation available to check for the JSON's validity.</p>