info.freelibrary.iiif.presentation.v3.services.GeoJsonService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jiiify-presentation-v3 Show documentation
Show all versions of jiiify-presentation-v3 Show documentation
A Java Library for version 3 of the IIIF Presentation API
package info.freelibrary.iiif.presentation.v3.services;
import java.net.URI;
import java.util.Optional;
import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonSetter;
import info.freelibrary.util.warnings.PMD;
import info.freelibrary.iiif.presentation.v3.Service;
import info.freelibrary.iiif.presentation.v3.utils.JsonKeys;
/**
* An external service that provides GeoJSON information.
*/
public class GeoJsonService extends AbstractService implements Service {
/**
* The GeoJSON service context.
*/
public static final String CONTEXT = "http://geojson.org/geojson-ld/geojson-context.jsonld";
/**
* Creates a GeoJSON service.
*
* @param aID The ID of the item to retrieve GeoJSON information about
*/
public GeoJsonService(final URI aID) {
super();
myID = aID;
}
@Override
@JsonIgnore
public GeoJsonService setID(final URI aID) {
return super.setID(aID);
}
@Override
@JsonSetter(JsonKeys.ID)
public GeoJsonService setID(final String aID) {
return super.setID(aID);
}
@Override
@JsonSetter(JsonKeys.TYPE)
public GeoJsonService setType(final String aType) {
myType = aType;
return this;
}
/**
* Gets the GeoJSON service's context.
*
* @return The authorization service's context
*/
@JsonGetter(JsonKeys.CONTEXT)
public String getContext() {
return CONTEXT;
}
/**
* Sets the GeoJSON service's context.
*
* @param aContext A authorization service context
* @return The authorization service
*/
@JsonSetter(JsonKeys.CONTEXT)
@SuppressWarnings(PMD.UNUSED_FORMAL_PARAMETER)
private GeoJsonService setContext(final String aContext) { // NOPMD
// This is intentionally left blank; context is a constant value
return this;
}
@Override
@JsonGetter(JsonKeys.PROFILE)
@JsonInclude(Include.NON_ABSENT)
public Optional getProfile() {
return Optional.empty();
}
@Override
public GeoJsonService setProfile(final String aProfile) {
return this; // intentionally a no-op, value is a constant
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy