MCPcopy Create free account
hub / github.com/grpc/grpc-java / parse

Method parse

core/src/main/java/io/grpc/internal/JsonParser.java:48–59  ·  view source on GitHub ↗

Parses a json string, returning either a Map , List<?>, String, Double, Boolean, or null. Fails if duplicate names found.

(String raw)

Source from the content-addressed store, hash-verified

46 * found.
47 */
48 public static Object parse(String raw) throws IOException {
49 JsonReader jr = new JsonReader(new StringReader(raw));
50 try {
51 return parseRecursive(jr);
52 } finally {
53 try {
54 jr.close();
55 } catch (IOException e) {
56 logger.log(Level.WARNING, "Failed to close", e);
57 }
58 }
59 }
60
61 private static Object parseRecursive(JsonReader jr) throws IOException {
62 checkState(jr.hasNext(), "unexpected end of JSON");

Calls 3

parseRecursiveMethod · 0.95
closeMethod · 0.65
logMethod · 0.45