title: Want to hide some fields of an object that are being mapped to JSON by Jackson
body: <p>I have a User class that I want to map to JSON using Jackson.</p>
  <pre><code>public class User {
      private String name;
      private int age;
      private int securityCode;
  
      // getters and setters
  }
  </code></pre>
  <p>I map this to a JSON string using -</p>
  <pre><code>User user = getUserFromDatabase();
  
  ObjectMapper mapper = new ObjectMapper();   
  String json =  mapper.writeValueAsString(user);
  </code></pre>
  <p>I don't want to map the <code>securityCode</code> variable. Is there any way of configuring the mapper so that it ignores this field?</p>
  <p>I know I can write custom data mappers or use the Streaming API but I would like to know if it possible to do it through configuration?</p>