title: jackson serialization, is there an annotation that indicates what sub-properties to use for a property?
body: <p>I'd like to see something like this</p>
  
  <pre><code>class User {
     @JsonMask({"name", "address"})
     private Company company;
     private String name;
     //...
  }
  class Company {
     private String name;
     private String address;
     private Set&lt;User&gt; employers;
     //...
  }
  </code></pre>
  
  <p>when a user is serialized, the output should be</p>
  
  <pre><code>{"name": "Mike", "company": {"name": "Enterprise Co.Ltd", "address": "....." }}
  </code></pre>
  
  <p>and the costly part <code>Set&lt;User&gt;</code> and other sub-properties is safely ignored.</p>
  
  <p>I'm not quite familiar with Jackson yet, and found only @JsonIgnore to the rescue, but then I would lose all those @JsonIgnored properties for ever. Is there an elegant way to solve this?</p>
  
  <p>Note: I'm using Hibernate JPA, so in my Model classes there are lots of relations, with deep relation chains and even cyclic references, so a full JSON serialization would always lead to hell ... I googled into @JsonManagedRef and friend, but that only solve the cyclic problem, and leads to a lot of config and is not very readable.</p>