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

info.freelibrary.iiif.presentation.v3.CanvasContent Maven / Gradle / Ivy

There is a newer version: 0.12.4
Show newest version

package info.freelibrary.iiif.presentation.v3;

import java.net.URI;
import java.util.Arrays;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonSetter;

import info.freelibrary.iiif.presentation.v3.properties.Behavior;
import info.freelibrary.iiif.presentation.v3.properties.Homepage;
import info.freelibrary.iiif.presentation.v3.properties.Label;
import info.freelibrary.iiif.presentation.v3.properties.Metadata;
import info.freelibrary.iiif.presentation.v3.properties.PartOf;
import info.freelibrary.iiif.presentation.v3.properties.Provider;
import info.freelibrary.iiif.presentation.v3.properties.Rendering;
import info.freelibrary.iiif.presentation.v3.properties.RequiredStatement;
import info.freelibrary.iiif.presentation.v3.properties.SeeAlso;
import info.freelibrary.iiif.presentation.v3.properties.Summary;
import info.freelibrary.iiif.presentation.v3.properties.behaviors.ResourceBehavior;
import info.freelibrary.iiif.presentation.v3.utils.JsonKeys;

/**
 * Canvas content that can be associated with a {@link PaintingAnnotation} or {@link SupplementingAnnotation}.
 */
public class CanvasContent extends AbstractContentResource
        implements AnnotationBody, EmbeddedResource, Resource {

    /**
     * Creates a canvas content resource from the supplied ID.
     *
     * @param aID A canvas content resource ID in string form
     */
    public CanvasContent(final String aID) {
        super(ResourceTypes.CANVAS, aID);
        super.setFormatFromMediaType(MediaType.APPLICATION_JSON);
    }

    /**
     * Creates a canvas content resource from the supplied ID.
     *
     * @param aID A canvas content resource ID
     */
    public CanvasContent(final URI aID) {
        super(ResourceTypes.CANVAS, aID);
        super.setFormatFromMediaType(MediaType.APPLICATION_JSON);
    }

    /**
     * Creates a canvas content resource for Jackson's deserialization processes.
     */
    private CanvasContent() {
        super(ResourceTypes.CANVAS);
        super.setFormatFromMediaType(MediaType.APPLICATION_JSON);
    }

    @Override
    @JsonSetter(JsonKeys.FORMAT)
    public CanvasContent setFormat(final String aMediaType) {
        return (CanvasContent) super.setFormat(aMediaType);
    }

    @Override
    @JsonIgnore
    public CanvasContent setFormat(final MediaType aMediaType) {
        return (CanvasContent) super.setFormat(aMediaType);
    }

    @Override
    @JsonSetter(JsonKeys.PROVIDER)
    public CanvasContent setProviders(final Provider... aProviderArray) {
        return setProviders(Arrays.asList(aProviderArray));
    }

    @Override
    @JsonIgnore
    public CanvasContent setProviders(final List aProviderList) {
        return (CanvasContent) super.setProviders(aProviderList);
    }

    @Override
    public CanvasContent clearBehaviors() {
        return (CanvasContent) super.clearBehaviors();
    }

    @Override
    @JsonSetter(JsonKeys.BEHAVIOR)
    public CanvasContent setBehaviors(final Behavior... aBehaviorArray) {
        return (CanvasContent) super.setBehaviors(checkBehaviors(ResourceBehavior.class, true, aBehaviorArray));
    }

    @Override
    public CanvasContent setBehaviors(final List aBehaviorList) {
        return (CanvasContent) super.setBehaviors(checkBehaviors(ResourceBehavior.class, true, aBehaviorList));
    }

    @Override
    public CanvasContent addBehaviors(final Behavior... aBehaviorArray) {
        return (CanvasContent) super.addBehaviors(checkBehaviors(ResourceBehavior.class, false, aBehaviorArray));
    }

    @Override
    public CanvasContent addBehaviors(final List aBehaviorList) {
        return (CanvasContent) super.addBehaviors(checkBehaviors(ResourceBehavior.class, false, aBehaviorList));
    }

    @Override
    public CanvasContent setSeeAlsoRefs(final SeeAlso... aSeeAlsoArray) {
        return (CanvasContent) super.setSeeAlsoRefs(aSeeAlsoArray);
    }

    @Override
    public CanvasContent setSeeAlsoRefs(final List aSeeAlsoList) {
        return (CanvasContent) super.setSeeAlsoRefs(aSeeAlsoList);
    }

    @Override
    public CanvasContent setServices(final Service... aServiceArray) {
        return (CanvasContent) super.setServices(aServiceArray);
    }

    @Override
    public CanvasContent setServices(final List> aServiceList) {
        return (CanvasContent) super.setServices(aServiceList);
    }

    @Override
    public CanvasContent setPartOfs(final PartOf... aPartOfArray) {
        return (CanvasContent) super.setPartOfs(aPartOfArray);
    }

    @Override
    public CanvasContent setPartOfs(final List aPartOfList) {
        return (CanvasContent) super.setPartOfs(aPartOfList);
    }

    @Override
    public CanvasContent setRenderings(final Rendering... aRenderingArray) {
        return (CanvasContent) super.setRenderings(aRenderingArray);
    }

    @Override
    public CanvasContent setRenderings(final List aRenderingList) {
        return (CanvasContent) super.setRenderings(aRenderingList);
    }

    @Override
    public CanvasContent setHomepages(final Homepage... aHomepageArray) {
        return (CanvasContent) super.setHomepages(aHomepageArray);
    }

    @Override
    public CanvasContent setHomepages(final List aHomepageList) {
        return (CanvasContent) super.setHomepages(aHomepageList);
    }

    @Override
    public CanvasContent setThumbnails(final ContentResource... aThumbnailArray) {
        return (CanvasContent) super.setThumbnails(aThumbnailArray);
    }

    @Override
    public CanvasContent setThumbnails(final List> aThumbnailList) {
        return (CanvasContent) super.setThumbnails(aThumbnailList);
    }

    @Override
    public CanvasContent setID(final String aID) {
        return (CanvasContent) super.setID(aID);
    }

    @Override
    public CanvasContent setID(final URI aID) {
        return (CanvasContent) super.setID(aID);
    }

    @Override
    public CanvasContent setRights(final String aRights) {
        return (CanvasContent) super.setRights(aRights);
    }

    @Override
    public CanvasContent setRights(final URI aRights) {
        return (CanvasContent) super.setRights(aRights);
    }

    @Override
    public CanvasContent setRequiredStatement(final RequiredStatement aStatement) {
        return (CanvasContent) super.setRequiredStatement(aStatement);
    }

    @Override
    public CanvasContent setSummary(final String aSummary) {
        return (CanvasContent) super.setSummary(aSummary);
    }

    @Override
    public CanvasContent setSummary(final Summary aSummary) {
        return (CanvasContent) super.setSummary(aSummary);
    }

    @Override
    public CanvasContent setMetadata(final Metadata... aMetadataArray) {
        return (CanvasContent) super.setMetadata(aMetadataArray);
    }

    @Override
    public CanvasContent setMetadata(final List aMetadataList) {
        return (CanvasContent) super.setMetadata(aMetadataList);
    }

    @Override
    public CanvasContent setLabel(final String aLabel) {
        return (CanvasContent) super.setLabel(aLabel);
    }

    @Override
    public CanvasContent setLabel(final Label aLabel) {
        return (CanvasContent) super.setLabel(aLabel);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy