title: Jackson JSON help (Serializer)
body: <p>I am using jackson 1.9.11.</p>
  
  <p>I need to create a JSON as follows : </p>
  
  <pre><code>"items": [
  {
  "batch": "sectionA",
  "id": "section1",
  "full": "N",
  "numStudents": 2,
  "students": [
      {
          "name": "John",
          "married": "Y"
  
      },
      {
          "name": "Mary",
          "married": "N"
      }
  ]
  },
  {
  "batch": "sectionB",
  "id": "section2",
  "full": "Y",
  "numStudents": 3,
  "students": [
      {
          "name": "John",
          "married": "Y"
  
      },
      {
          "name": "Mary",
          "married": "N"
      },
      {
          "name": "Sam",
          "married": "N"
      }
  ]
  }
  
  ]
  </code></pre>
  
  <p>I have a HashMap with : <code>"items" = List&lt;Batch&gt;</code></p>
  
  <p>Each Batch the following variables : batch,<code>List&lt;Students&gt;</code></p>
  
  <p>I need to evaluate : "full" based on some values in a HashMap (this Map gets created using some helper classes).</p>
  
  <p>"numStudents" is <code>List&lt;Students&gt;.size()</code></p>
  
  <p>"id" is "section" appended with the index of this Batch in <code>List&lt;Batch&gt;</code></p>
  
  <p>Now the problem is that i cannot modify these classes as they are part of a library. How do i go about solving this problem ?</p>