Package com.firefly.utils.json

Source Code of com.firefly.utils.json.Json

package com.firefly.utils.json;

import java.io.IOException;

import com.firefly.utils.json.serializer.StateMachine;
import com.firefly.utils.json.support.JsonStringWriter;


public abstract class Json {
  public static String toJson(Object obj) {
    String ret = null;
    JsonStringWriter writer = new JsonStringWriter();
    try {
      StateMachine.toJson(obj, writer);
      ret = writer.toString();
    } catch (IOException e) {
      e.printStackTrace();
    } finally {
      writer.close();
    }
    return ret;
  }
}
TOP

Related Classes of com.firefly.utils.json.Json

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.