title: How to configure Jackson to convert all fields of a type to another type?
body: <p>If I have a POJO field of type <code>A</code> that I want serialized as being of type <code>B</code>, I can easily achieve this with a pair of <code>Converter</code>s:</p>
  
  <pre><code>@JsonSerialize(converter=ConvA2B.class)
  @JsonDeserialize(converter=ConvB2A.class)
  private A field; 
  </code></pre>
  
  <p>But what if I want all the fields of that type in all the POJOs to be treated like that? Is there a global converters configuration?</p>
  
  <hr>
  
  <p>To provide a bit of context, I'm trying to <a href="https://stackoverflow.com/q/51284630/3127111">serialize <code>java.time.LocalDateTime</code> fields as unix timestamps</a> and one possible solution I found is to convert each field to <code>java.time.Instant</code> with a custom type converter such as:</p>
  
  <pre><code>public static class Conv extends StdConverter&lt;LocalDateTime, Instant&gt; {
  
      @Override
      public Instant convert(LocalDateTime value) {
          return value.toInstant(ZoneOffset.UTC);
      }
  
  }
  </code></pre>