Invoke object constructor when deserializing json using libgdx
问题 How come my objects constructor for player is not called during deserialization? Is there a way to invoke the constructor using this approach? Load json into java object using com.badlogic.gdx.utils.Json .. LevelModel ld = new Json(). fromJson(LevelModel.class, Gdx.files.internal("levels/level1.json")); setLevel(new Level(ld)); Heres my JSON .. { "gravity": { "x": 0.0, "y": 0.0 }, "sounds": [ BGMUSIC ], "player": { "maxSpeed": 10.0 } } LevelModel.java looks like this .. public class