private static void writeObject(JsonWriter writer, Object value) throws IOException {
    if (value == null) {
      writer.nullValue();
    } else {
      Class<?> c = value.getClass();
      if (c.isArray()) {
        writer.beginArray();
        int len = Array.getLength(value);
        for (int j = 0; j < len; j++) {
          Object item = Array.get(value, j);
          writeObject(writer, item);
        }
        writer.endArray();
      } else if (value instanceof Number) {
        Number n = (Number) value;
        if (Double.isFinite(n.doubleValue())) {
          writer.value(n);
        } else {
          writer.value(n.toString());
        }
      } else if (value instanceof Boolean) {
        Boolean b = (Boolean) value;
        writer.value(b);
      } else if (value instanceof CompositeData) {
        CompositeData cds = (CompositeData) value;
        CompositeType comp = cds.getCompositeType();
        Set<String> keys = comp.keySet();
        writer.beginObject();
        for (String key : keys) {
          writeAttribute(writer, key, null, cds.get(key));
        }
        writer.endObject();
      } else if (value instanceof TabularData) {
        TabularData tds = (TabularData) value;
        writer.beginArray();
        for (Object entry : tds.values()) {
          writeObject(writer, entry);
        }
        writer.endArray();
      } else {
        writer.value(value.toString());
      }
    }
  }
Returns Return non-zero if failed to find bean. 0
hbase-http/src/main/java/org/apache/hadoop/hbase/util/JSONBean.java