Example usage for com.badlogic.gdx.utils Json toJson

List of usage examples for com.badlogic.gdx.utils Json toJson

Introduction

In this page you can find the example usage for com.badlogic.gdx.utils Json toJson.

Prototype

public void toJson(Object object, Class knownType, Writer writer) 

Source Link

Usage

From source file:com.bladecoder.engine.ui.Recorder.java

License:Apache License

public void save() {

    Json json = new Json();

    //      String s = json.prettyPrint(list);
    String s = json.toJson(list, ArrayList.class, TimeVerb.class);

    Writer w = EngineAssetManager.getInstance().getUserFile(fileName + RECORD_EXT).writer(false, "UTF-8");

    try {/*from   w  ww. jav  a  2 s .c  o m*/
        w.write(s);
        w.close();
    } catch (IOException e) {
        EngineLogger.error("ERROR SAVING RECORD", e);
    }
}