001package org.gbif.dwc.terms.jackson;
002
003import org.gbif.dwc.terms.Term;
004
005import java.io.IOException;
006
007import org.codehaus.jackson.JsonGenerator;
008import org.codehaus.jackson.JsonProcessingException;
009import org.codehaus.jackson.map.JsonSerializer;
010import org.codehaus.jackson.map.SerializerProvider;
011
012/**
013 * A json serializer that turns dwc terms into their full qualified term name.
014 */
015public class TermSerializer extends JsonSerializer<Term> {
016
017  @Override
018  public void serialize(Term value, JsonGenerator jgen, SerializerProvider provider)
019    throws IOException, JsonProcessingException {
020    jgen.writeString(value.qualifiedName());
021  }
022}