title: Jackson - custom serializer that overrides only specific fields
body: <p>I know how to use a custom serializer in Jackson (by extending <code>JsonSerializer</code>), but I want the default serializer to work for all fields, except for just 1 field, which I want to override using the custom serializer. </p>
  
  <p>Annotations are not an option, because I am serializing a generated class (from Thrift). </p>
  
  <p>How do I specify only certain fields to be overridden when writing a custom jackson serializer?</p>
  
  <p><em>Update:</em></p>
  
  <p>Here's the class I want to serialize:</p>
  
  <pre><code>class Student {
      int age;
      String firstName;
      String lastName;
      double average;
      int numSubjects
  
      // .. more such properties ...
  }
  </code></pre>
  
  <p>The above class has many properies, most of which use native types. I want to just override a few properties in the custom serializer and let Jackson deal with the rest as usual. For e.g. I just want to convert the "age" field to a custom output. </p>