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

info.freelibrary.iiif.presentation.v3.properties.ValueDeserializer 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 values from JSON documents into {@link Value} objects.
 */
class ValueDeserializer extends AbstractI18nStdDeserializer {

    /**
     * The serialVersionUID of ValueSerializer.
     */
    private static final long serialVersionUID = 8482393289401619224L;

    /**
     * Creates a new value deserializer.
     */
    ValueDeserializer() {
        this(null);
    }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy