com.podio.serialize.LocaleSerializer Maven / Gradle / Ivy
package com.podio.serialize;
import java.io.IOException;
import java.util.Locale;
import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.JsonSerializer;
import org.codehaus.jackson.map.SerializerProvider;
public class LocaleSerializer extends JsonSerializer {
@Override
public void serialize(Locale value, JsonGenerator jgen,
SerializerProvider provider) throws IOException,
JsonProcessingException {
jgen.writeString(value.getLanguage() + "_" + value.getCountry());
}
}