title: Custom Jackson serialization while using @JsonFilter
body: <p>I have a need similar to this question: <a href="https://stackoverflow.com/questions/9457794/custom-jackson-serializer-for-wrapper-object">Custom Jackson Serializer for Wrapper Object</a>, but when using @JsonFilter.</p>
  
  <p>I have an object structure like this:</p>
  
  <pre><code>@JsonFilter("orderFilter")
  class Order {
      Address address;
      /* other undesired fields below */
  }
  
  @JsonFilter("addressFilter")
  class Address {
      User user;
      /* other undesired fields below */
  }
  
  class User {
      Integer userId;
      /* other undesired fields below */
  }
  </code></pre>
  
  <p>(I know this model doesn't make logical sense, its just for illustrating the problem)</p>
  
  <p>I am using the @JsonFilter system to select specific fields at each level to include, both for security purposes and for scoping my api in a logical way. This is working fine, including a custom class that implements <code>PropertyFilter</code>.</p>
  
  <p>I need serialize User as just the userId property, but cannot use annotations on the User class, since in other situations I will need to serialize the entire class. </p>
  
  <p>For example, I would like to have the following output:</p>
  
  <pre><code>{ "address" : { "userId" : 1234 }}
  </code></pre>
  
  <p>My <code>PropertyFilter</code> implementation has a method like this:</p>
  
  <pre><code>    @Override
      public void serializeAsField(Object pojo, JsonGenerator jgen, SerializerProvider prov, PropertyWriter writer)
              throws Exception {
          if (include(writer)) {
              writer.serializeAsField(pojo, jgen, prov);
          }
      }
  </code></pre>
  
  <p>and I know I can identify the user object with <code>writer.getName().equals("user")</code>, but what do I do next to control the output at this point?</p>
  
  <p><strong>Bonus question</strong></p>
  
  <p>Imagine <code>Address</code> had another property <code>List&lt;Notes&gt; notes</code>. How could I extend this solution to filter the list so that a filtered list of notes is included in the JSON output? In other words, some notes are for all users, but some are only for administrators. When a regular user is executing this call, I want to filter out admin notes.</p>