gu.sql2java.geometry.jackson.GeometrySerializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sql2java-base Show documentation
Show all versions of sql2java-base Show documentation
sql2java common class package
package gu.sql2java.geometry.jackson;
import java.io.IOException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.vividsolutions.jts.geom.Geometry;
/**
* Serializing Geometry property as WKT String with Jackson
* @author guyadong
* @since 3.18.0
* @param
*/
public class GeometrySerializer extends JsonSerializer {
@Override
public void serialize(T value, JsonGenerator gen, SerializerProvider serializers)
throws IOException, JsonProcessingException {
gen.writeString(value.toText());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy