code: private <T> T readNameOrValue(TypedParser<T> ch) {
          getCurrentContext().read();
  
          final JsonNode elem = getCurrentContext().getCurrentChild();
          if (getCurrentContext().isMapKey()) {
              // Will throw a ClassCastException if this is not a JsonPrimitive string
              return ch.readFromString(elem.asText());
          } else {
              return ch.readFromJsonElement(elem);
          }
      }
docs: Read in a value of the given type, either as a name (meaning the
  JSONElement is a string and we convert it), or as a value
  (meaning the JSONElement has the type we expect).
  Uses a TypedParser to do the real work.
  
  <p>TODO(Alex Roetter): not sure TypedParser is a win for the number of
  lines it saves. Consider expanding out all the readX() methods to
  do what readNameOrValue does, calling the relevant methods from
  the TypedParser directly.