com.dynamicpdf.api.FloatJsonSerializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dynamicpdf-api Show documentation
Show all versions of dynamicpdf-api Show documentation
A Java Client API that uses the DynamicPDF API to create, merge, split, form fill, stamp, secure/encrypt PDF documents.
package com.dynamicpdf.api;
import java.io.IOException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
/**
* This class is meant for DynamicPDF's internal usage and not supposed to be used by the client programs.
*/
public class FloatJsonSerializer extends JsonSerializer{
@Override
public void serialize(Float value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
gen.writeNumber(Float.toString(value).replaceAll("\\.?0*$", ""));
}
}