title: LibGDX JSON object saving/serializing
body: <p>I've been scouring the internet about how to use JSON with libgdx, specifically loading and saving objects, but all I've been able to find is tutorials dealing with 1 object only. In my case I am going to be dealing with lots of objects inside lots of other objects. </p>
  
  <p>To put this into perspective, lets say I have a <code>World</code> class. </p>
  
  <p>Within the <code>World</code> class there is a list of <code>Level</code> classes.</p>
  
  <p>Within each <code>Level</code> class there is an array of <code>Tile</code> classes.</p>
  
  <p>Within each <code>Tile</code> class there is a <code>TopTile</code> class and a <code>BotTile</code> class.</p>
  
  <p>The <code>BotTile</code> and <code>TopTile</code> classes contain Integers and Strings and things.</p>
  
  <p>Within each <code>Level</code> class there are also <code>Entity</code> lists</p>
  
  <p>Each <code>Entity</code> has an <code>Inventory</code> which has <code>Items</code></p>
  
  <p>As you can see, there are a lot of classes, and within these classes there are more classes. Do I have to write a saving wrapper for every single class? I understand I could just save the whole <code>World</code> class, and to my understanding this would just pile everything in to one file, but there is a lot of garbage that doesn't need to be saved in all the other classes. How should I go about saving my <code>World</code> class?</p>
  
  <p>To clarify, when I mentioned a saving wrapper, I mean a set of methods in object <code>X</code> which save and load <code>X</code> using only necessary parameters, thus getting rid of all the garbage. But, I have so many objects that might be saved that writing wrappers for each of these seems like a lot.</p>
  
  <p>Another thing is, in the case of an <code>Inventory</code> class containing <code>Items</code>, I would only want to save the contents of the inventory, not the actual <code>Item</code> classes because nothing is changing about each <code>Item</code>. Though would saving the <code>Inventory</code> not save all of the items it contains as well? I find this all a bit confusing. What is being saved? what is not being saved? This is all using the libGDX JSON parser, of objects I am assuming.</p>
  
  <p>Any suggestions would be greatly appreciated.</p>