Jackson - Custom serializer for propeties inside object
<p>I'm looking for a way to output all BigIntegers as string using Jackson. These BigIntegers are used in many classes all over my app, so adding @JsonSerialize to all fields is not an option.</p>

<p>I have created a custom Jackson serializer, but this only works on the base class, being serialized, not the properties inside the class. So, this does not work:</p>

<pre><code>public class BigIntegerSerializer extends JsonSerializer&lt;BigInteger&gt; {

    @Override
    public void serialize(BigInteger value, JsonGenerator jgen,
                      SerializerProvider provider) throws IOException {
        jgen.writeString(value + "");
    }
}
</code></pre>

<p>Is there a way to have a Jackson serialized on all properties of a certain type, without adding @JsonSerialize to all?</p>

<p>The object to be serialized can be any POJO containing BigIntegers.</p>

<p>PS: The idea to convert BigIntegers to String is so that JavaScript will not convert these numbers to scientific notation. All my primary keys use BigInteger, so when JavaScript converts them to scientific notation, I can not longer use them.</p>