public static String getJSONString(Object o, ObjectInspector oi, String nullStr) {
    StringBuilder sb = new StringBuilder();
    buildJSONString(sb, o, oi, nullStr);
    return sb.toString();
  }
Use this if you need to have custom representation of top level null .
(ie something other than 'null')
eg, for hive output, we want to to print NULL for a null map object.
@param o Object
@param oi ObjectInspector
@param nullStr The custom string used to represent null value
@return
serde/src/java/org/apache/hadoop/hive/serde2/SerDeUtils.java