nl.vpro.domain.api.jackson.ExtendedTextMatcherListJson Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api-domain Show documentation
Show all versions of api-domain Show documentation
Contains the objects used by the Frontend API, like forms and result objects
/*
* Copyright (C) 2016 All rights reserved
* VPRO The Netherlands
*/
package nl.vpro.domain.api.jackson;
import java.io.IOException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import nl.vpro.domain.api.ExtendedTextMatcher;
import nl.vpro.domain.api.ExtendedTextMatcherList;
import nl.vpro.domain.api.StandardMatchType;
/**
* @author rico
* @since 4.6
*/
public class ExtendedTextMatcherListJson extends AbstractTextMatcherListJson {
private static final ExtendedTextMatcherJson SERIALIZER = new ExtendedTextMatcherJson();
private static final ExtendedTextMatcherListJson LIST_SERIALIZER = new ExtendedTextMatcherListJson();
public ExtendedTextMatcherListJson() {
super(ExtendedTextMatcherList::new, ExtendedTextMatcher.class, SERIALIZER);
}
public static class Serializer extends JsonSerializer {
@Override
public void serialize(ExtendedTextMatcherList value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
LIST_SERIALIZER.serialize(value, gen);
}
}
public static class Deserializer extends JsonDeserializer {
@Override
public ExtendedTextMatcherList deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
return LIST_SERIALIZER.deserialize(p);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy