private Object wrap()

in pig/src/main/java/com/twitter/elephantbird/pig/load/JsonLoader.java [184:201]


  private Object wrap(Object value) {
    
    if (isNestedLoadEnabled && value instanceof JSONObject) {
      return walkJson((JSONObject) value);
    }  else if (isNestedLoadEnabled && value instanceof JSONArray) {
      
      JSONArray a = (JSONArray) value;
      DataBag mapValue = new NonSpillableDataBag(a.size());
      for (int i=0; i<a.size(); i++) {
        Tuple t = tupleFactory.newTuple(wrap(a.get(i)));
        mapValue.add(t);
      }
      return mapValue;
      
    } else {
      return value != null ? value.toString() : null;
    }
  }