All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nl.vpro.domain.media.bind.AspectRatioToString Maven / Gradle / Ivy

Go to download

The basic domain classes for 'media', the core of POMS. Also, the 'update' XML bindings for it. It also contains some closely related domain classes like the enum to contain NICAM kijkwijzer settings.

There is a newer version: 8.3.1
Show newest version
package nl.vpro.domain.media.bind;

import java.io.IOException;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.*;

import nl.vpro.domain.media.AspectRatio;

/**
 * @author Michiel Meeuwissen
 * @since 2.0
 */
public class AspectRatioToString {

    private AspectRatioToString() {
    }

    public static class Serializer extends JsonSerializer {

        @Override
        public void serialize(AspectRatio value, JsonGenerator jgen, SerializerProvider provider) throws IOException {
            jgen.writeString(value.toString());
        }
    }

    public static class Deserializer extends JsonDeserializer {
        @Override
        public AspectRatio deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException {
            return AspectRatio.fromString(jp.getText());
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy