title: Jackson: Serialize only marked fields
body: <p>I am trying to do something which was quite easy in gson. Since I switched to Jackson as serializer, I couldn't figure out how to implement this:</p>
  
  <p>I want to serialize only fields that have been marked by an Annotation. GSON code would be:</p>
  
  <pre><code>class Foo {
      @Expose
      public String sometext="Hello World";
      @Expose
      public int somenumber=30;
      public float noop=1.0;
      ...
   }
  </code></pre>
  
  <p>which should result in (JSON)</p>
  
  <pre><code> {
      Foo: {
          sometext:'Hello World',
          somenumber: 30
      }
   }
  </code></pre>
  
  <p>(Syntax errors may be ignored - source is just for demonstration)</p>
  
  <p>So what's the Jackson counterpart for gson's <code>@Expose</code> and <code>new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();</code>? </p>