title: How to map JSON field names to different object field names?
body: <p>What is the equiv way in Jackson json annotation for the following jax-b annotations?</p>
  
  <p>I need to produce json rather than xml and need to know the conventional jackson annotations that is equivalently denoted in jax-b.</p>
  
  <ol>
  <li>rename a field.</li>
  <li>use getters instead of fields.</li>
  </ol>
  
  <p>These features are especially crucial if the json/xml element name is a java reserved word
  like "<code>new</code>", "<code>public</code>", "<code>static</code>", etc.</p>
  
  <p>So that we have to name the POJO fields as "_new_", "_public_", "_static_", etc, respectively,</p>
  
  <p>but use jax-b annotation to rename them back to "new", "public", "static", etc
  in the generated XML (and json) elements.</p>
  
  <p><strong>Renaming a field</strong><br/></p>
  
  <pre><code>@XmlAccessorType(XmlAccessType.FIELD)
  public class Person{
      @XmlElement(required = true)
      protected String name;
      @XmlElement(required = true)
      protected String address;
      @XmlElement(name = "contractor")
      protected boolean _restricted_ ;
      @XmlElement(name = "new")
      protected boolean _new_ ;
  }
  </code></pre>
  
  <p><strong>Redirect to using property getter</strong> (I think this is how it is done in jax-b)<br/></p>
  
  <pre><code>@XmlAccessorType(XmlAccessType.PROPERTY)
  public class Person{
      protected String name;
      protected String address;
      protected boolean _restricted_ ;
      protected boolean _new_ ;
  
      @XmlElement(required = true)
      protected String getName() {return name;}
      @XmlElement(required = true)
      protected String getAddress() {return address;}
      @XmlElement(name = "contractor")
      protected boolean getRestricted() {return _restricted_;}
      @XmlElement(name = "new")
      protected boolean getNew(){return _new_;}
  }
  </code></pre>