title: Using a custom marshaller in Jackson without annotations?
body: <p>I need to use Jackson to marshal and unmarshal json on arbitrary objects, and I need a certain date format.</p>
  
  <p>Right now, I have this:</p>
  
  <pre><code>final ObjectMapper mapper = new ObjectMapper()
  mapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true)
  mapper.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true)
  </code></pre>
  
  <p>When I run <code>mapper.writeValueAsString([a:new Date()])</code>, I get a timestamp. My previous marshaling solution used this:</p>
  
  <p><code>ISODateTimeFormat.dateTime().withZoneUTC().print(it.getTime())</code></p>
  
  <p>but I can only seem to find a way to set a specific marshaller in Jackson with annotations. I have multiple classes for which I need particular marshaling, none of which can be annotated. Is there a way to set up marshaler by class?</p>