private JsonNode walkObjectGraph(final ObjectInspector oi, final Object o,
      final List<String> fieldNames)
      throws SerDeException {

    if (o != null) {
      switch (oi.getCategory()) {
      case LIST:
        return visitList(oi, o);
      case STRUCT:
        return visitStruct(oi, o, fieldNames);
      case MAP:
        return visitMap(oi, o);
      case PRIMITIVE:
        return primitiveToNode(oi, o);
      case UNION:
        return visitUnion(oi, o);
      default:
        throw new SerDeException(
            "Parsing of: " + oi.getCategory() + " is not supported");
      }
    }
    return this.nodeFactory.nullNode();
  }
Walk the object graph.

@param oi The ObjectInspector describing the Object
@param o The object to convert
@param fieldNames List of field names to use, default names used otherwise
@return A JsonNode representation of the Object
@throws SerDeException The Object cannot be parsed
serde/src/java/org/apache/hadoop/hive/serde2/json/HiveJsonWriter.java