List of usage examples for com.fasterxml.jackson.databind.ser.std NonTypedScalarSerializerBase NonTypedScalarSerializerBase
protected NonTypedScalarSerializerBase(Class<T> paramClass)
From source file:fr.norad.jmxzabbix.core.ZabbixClient.java
public ZabbixClient(ZabbixConfig config) { this.config = config; // zabbix does not understand boolean with value true without quotes which is default of jackson SimpleModule module = new SimpleModule("BooleanAsString", new Version(1, 0, 0, null, null, null)); module.addSerializer(new NonTypedScalarSerializerBase<Boolean>(Boolean.class) { @Override/*from w w w. j a v a 2 s . co m*/ public void serialize(Boolean value, JsonGenerator jgen, SerializerProvider provider) throws IOException { jgen.writeString(value.toString()); } }); mapper.registerModule(module); }