Code example for JsonSyntaxException

0
        return JsonNull.INSTANCE;
      } 
      // The stream ended prematurely so it is likely a syntax error. 
      throw new JsonSyntaxException(e);
    } catch (MalformedJsonException e) {
      throw new JsonSyntaxException(e);
    } catch (IOException e) {
      throw new JsonIOException(e);
    } catch (NumberFormatException e) {
      throw new JsonSyntaxException(e);
    } 
  } 
 
  /** 
   * Writes the JSON element to the writer, recursively. 
   */ 
  public static void write(JsonElement element, JsonWriter writer) throws IOException {
    TypeAdapters.JSON_ELEMENT.write(writer, element);
  }