@Override public void promoteNameToValue(JsonReader reader) throws IOException { if (reader instanceof JsonTreeReader) { ((JsonTreeReader)reader).promoteNameToValue(); return; } int p = reader.peeked; if (p == PEEKED_NONE) { p = reader.doPeek(); } if (p == PEEKED_DOUBLE_QUOTED_NAME) { reader.peeked = PEEKED_DOUBLE_QUOTED; } else if (p == PEEKED_SINGLE_QUOTED_NAME) { reader.peeked = PEEKED_SINGLE_QUOTED; } else if (p == PEEKED_UNQUOTED_NAME) { reader.peeked = PEEKED_UNQUOTED; } else { throw new IllegalStateException("Expected a name but was " + reader.peek() + " " + " at line " + reader.getLineNumber() + " column " + reader.getColumnNumber()); } }
public void promoteNameToValue(JsonReader reader) throws IOException { if (reader instanceof JsonTreeReader) { ((JsonTreeReader) reader).promoteNameToValue(); return; } int p = reader.peeked; if (p == 0) { p = reader.doPeek(); } if (p == 13) { reader.peeked = 9; } else if (p == 12) { reader.peeked = 8; } else if (p == 14) { reader.peeked = 10; } else { throw new IllegalStateException("Expected a name but was " + reader.peek() + " " + " at line " + reader.getLineNumber() + " column " + reader .getColumnNumber() + " path " + reader.getPath()); } }
@Override public void promoteNameToValue(JsonReader reader) throws IOException { if (reader instanceof JsonTreeReader) { ((JsonTreeReader)reader).promoteNameToValue(); return; } int p = reader.peeked; if (p == PEEKED_NONE) { p = reader.doPeek(); } if (p == PEEKED_DOUBLE_QUOTED_NAME) { reader.peeked = PEEKED_DOUBLE_QUOTED; } else if (p == PEEKED_SINGLE_QUOTED_NAME) { reader.peeked = PEEKED_SINGLE_QUOTED; } else if (p == PEEKED_UNQUOTED_NAME) { reader.peeked = PEEKED_UNQUOTED; } else { throw new IllegalStateException("Expected a name but was " + reader.peek() + " " + " at line " + reader.getLineNumber() + " column " + reader.getColumnNumber() + " path " + reader.getPath()); } }
@Override public void promoteNameToValue(JsonReader reader) throws IOException { if (reader instanceof JsonTreeReader) { ((JsonTreeReader)reader).promoteNameToValue(); return; } int p = reader.peeked; if (p == PEEKED_NONE) { p = reader.doPeek(); } if (p == PEEKED_DOUBLE_QUOTED_NAME) { reader.peeked = PEEKED_DOUBLE_QUOTED; } else if (p == PEEKED_SINGLE_QUOTED_NAME) { reader.peeked = PEEKED_SINGLE_QUOTED; } else if (p == PEEKED_UNQUOTED_NAME) { reader.peeked = PEEKED_UNQUOTED; } else { throw new IllegalStateException( "Expected a name but was " + reader.peek() + reader.locationString()); } }
public final void promoteNameToValue(JsonReader paramAnonymousJsonReader) throws IOException { if ((paramAnonymousJsonReader instanceof JsonTreeReader)) { JsonTreeReader localJsonTreeReader = (JsonTreeReader)paramAnonymousJsonReader; localJsonTreeReader.expect(JsonToken.NAME); Map.Entry localEntry = (Map.Entry)((Iterator)localJsonTreeReader.peekStack()).next(); localJsonTreeReader.stack.add(localEntry.getValue()); localJsonTreeReader.stack.add(new JsonPrimitive((String)localEntry.getKey())); return; } paramAnonymousJsonReader.peek(); if (paramAnonymousJsonReader.token != JsonToken.NAME) { throw new IllegalStateException("Expected a name but was " + paramAnonymousJsonReader.peek() + " at line " + paramAnonymousJsonReader.getLineNumber() + " column " + paramAnonymousJsonReader.getColumnNumber()); } JsonReader.access$302(paramAnonymousJsonReader, paramAnonymousJsonReader.name); JsonReader.access$402$66c5ad48(paramAnonymousJsonReader); JsonReader.access$002(paramAnonymousJsonReader, JsonToken.STRING); }
public void promoteNameToValue(JsonReader reader) throws IOException { if (reader instanceof JsonTreeReader) { ((JsonTreeReader) reader).promoteNameToValue(); return; } reader.peek(); if (reader.token != JsonToken.NAME) { throw new IllegalStateException("Expected a name but was " + reader.peek() + " " + " at line " + reader.getLineNumber() + " column " + reader.getColumnNumber()); } reader.value = reader.name; reader.name = null; reader.token = JsonToken.STRING; }
final T fromJsonTree(JsonElement jsonTree) { try { JsonReader jsonReader = new JsonTreeReader(jsonTree); jsonReader.setLenient(true); return read(jsonReader); } catch (Throwable e) { throw new JsonIOException(e); } }
/** * Converts {@code jsonTree} to a Java object. * * @param jsonTree the Java object to convert. May be {@link JsonNull}. * @since 2.2 */ public final T fromJsonTree(JsonElement jsonTree) { try { JsonReader jsonReader = new JsonTreeReader(jsonTree); return read(jsonReader); } catch (IOException e) { throw new JsonIOException(e); } }
public final T fromJsonTree(JsonElement jsonTree) { try { return read(new JsonTreeReader(jsonTree)); } catch (Throwable e) { throw new JsonIOException(e); } }
public void promoteNameToValue(JsonReader jsonreader) { if (jsonreader instanceof JsonTreeReader) { ((JsonTreeReader)jsonreader).promoteNameToValue(); return; } int i = JsonReader.a(jsonreader); if (i == 0) { i = JsonReader.b(jsonreader); } if (i == 13) { JsonReader.a(jsonreader, 9); return; } if (i == 12) { JsonReader.a(jsonreader, 8); return; } if (i == 14) { JsonReader.a(jsonreader, 10); return; } else { throw new IllegalStateException((new StringBuilder()).append("Expected a name but was ").append(jsonreader.peek()).append(" ").append(" at line ").append(JsonReader.c(jsonreader)).append(" column ").append(JsonReader.d(jsonreader)).toString()); } }
public Object fromJson(JsonElement jsonelement, Type type) { if (jsonelement == null) { return null; } else { return fromJson(((JsonReader) (new JsonTreeReader(jsonelement))), type); } }
public final Object fromJsonTree(JsonElement jsonelement) { Object obj; try { obj = read(new JsonTreeReader(jsonelement)); } catch (IOException ioexception) { throw new JsonIOException(ioexception); } return obj; }
/** * Converts {@code jsonTree} to a Java object. * * @param jsonTree the Java object to convert. May be {@link com.google.gson.JsonNull}. * @since 2.2 */ public final T fromJsonTree(JsonElement jsonTree) { try { JsonReader jsonReader = new JsonTreeReader(jsonTree); return read(jsonReader); } catch (IOException e) { throw new JsonIOException(e); } }
@Override public void promoteNameToValue(JsonReader reader) throws IOException { if (reader instanceof JsonTreeReader) { ((JsonTreeReader)reader).promoteNameToValue(); return; } reader.peek(); if (reader.token != JsonToken.NAME) { throw new IllegalStateException("Expected a name but was " + reader.peek() + " " + " at line " + reader.getLineNumber() + " column " + reader.getColumnNumber()); } reader.value = reader.name; reader.name = null; reader.token = JsonToken.STRING; }
/** * Converts {@code jsonTree} to a Java object. * * @param jsonTree the Java object to convert. May be {@link JsonNull}. */ public T fromJsonTree(JsonElement jsonTree) { try { JsonReader jsonReader = new JsonTreeReader(jsonTree); jsonReader.setLenient(true); return read(jsonReader); } catch (IOException e) { throw new JsonIOException(e); } }
/** * Converts {@code jsonTree} to a Java object. * * @param jsonTree the Java object to convert. May be {@link JsonNull}. */ /*public*/ final T fromJsonTree(JsonElement jsonTree) { try { JsonReader jsonReader = new JsonTreeReader(jsonTree); jsonReader.setLenient(true); return read(jsonReader); } catch (IOException e) { throw new JsonIOException(e); } }