@SuppressWarnings("unchecked") <T>T parse(Class<T> clazz) throws JsonParserException {
  advanceToken();
  Object parsed=currentValue();
  if (advanceToken() != Token.EOF)   throw createParseException(null,"Expected end of input, got " + token,true);
  if (clazz != Object.class && (parsed == null || clazz != parsed.getClass()))   throw createParseException(null,"JSON did not contain the correct type, expected " + clazz.getName() + ".",true);
  return (T)(parsed);
}

@ SuppressWarnings ( "unchecked" ) < T > T parse ( Class < T > clazz ) throws JsonParserException { advanceToken ( ) ; Object parsed = currentValue ( ) ; if ( advanceToken ( ) != Token . EOF ) throw createParseException ( null , "Expected end of input, got " + token , true ) ; if ( clazz != Object . class && ( parsed == null || clazz != parsed . getClass ( ) ) ) throw createParseException ( null , "JSON did not contain the correct type, expected " + clazz . getName ( ) + "." , true ) ; return ( T ) ( parsed ) ; }
parse a single json value from the string , expecting an eof at the end .
