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

info.freelibrary.iiif.presentation.v3.properties.SummaryDeserializer Maven / Gradle / Ivy

There is a newer version: 0.12.4
Show newest version

package info.freelibrary.iiif.presentation.v3.properties;

import java.io.IOException;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationContext;

/**
 * Deserializes summaries from JSON documents into {@link Summary} objects.
 */
class SummaryDeserializer extends AbstractI18nStdDeserializer {

    /**
     * The serialVersionUID of SummarySerializer.
     */
    private static final long serialVersionUID = 6825081668840056682L;

    /**
     * Creates a new summary deserializer.
     */
    SummaryDeserializer() {
        this(null);
    }

    /**
     * Creates a new summary deserializer.
     *
     * @param aClass A class
     */
    SummaryDeserializer(final Class aClass) {
        super(aClass);
    }

    /**
     * Deserializes a Summary from its JSON structure.
     */
    @Override
    public Summary deserialize(final JsonParser aParser, final DeserializationContext aContext)
            throws IOException, JsonProcessingException {
        return new Summary(getI18nStrings(aParser.getCodec().readTree(aParser)));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy