Class Resource<T>
- java.lang.Object
-
- de.digitalcollections.iiif.model.sharedcanvas.Resource<T>
-
- Type Parameters:
T- a resource type, e.g. Canvas, Annotation
- All Implemented Interfaces:
Choice<T>
- Direct Known Subclasses:
Annotation,AnnotationList,Canvas,Collection,ContentAsText,ImageContent,Layer,Manifest,OtherContent,Range,Sequence,SpecificResource
public abstract class Resource<T> extends Object implements Choice<T>
Abstract IIIF resource, most other resources are based on this.
-
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.digitalcollections.iiif.model.openannotation.Choice
addAlternative
-
-
-
-
Field Detail
-
CONTEXT
public static final String CONTEXT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Resource
public Resource()
-
Resource
public Resource(String identifier)
-
-
Method Detail
-
getType
public String getType()
-
getIdentifier
public URI getIdentifier()
-
setIdentifier
protected void setIdentifier(URI identifier)
-
getThumbnails
public List<ImageContent> getThumbnails()
-
getThumbnail
public ImageContent getThumbnail()
-
setThumbnails
public void setThumbnails(List<ImageContent> thumbnails)
-
addThumbnail
public Resource addThumbnail(ImageContent... thumbnails)
-
getMetadata
public List<MetadataEntry> getMetadata()
-
addMetadata
public Resource addMetadata(MetadataEntry... meta)
-
getLabel
public PropertyValue getLabel()
-
getLabelString
public String getLabelString()
-
setLabel
public void setLabel(PropertyValue label)
-
getDescription
public PropertyValue getDescription()
-
getDescriptionString
public String getDescriptionString()
-
setDescription
public void setDescription(PropertyValue description)
-
getAttribution
public PropertyValue getAttribution()
-
getAttributionString
public String getAttributionString()
-
setAttribution
public void setAttribution(PropertyValue attribution)
-
getFirstLicense
public URI getFirstLicense()
-
getLogos
public List<ImageContent> getLogos()
-
getLogoUri
public URI getLogoUri()
-
setLogos
public void setLogos(List<ImageContent> logos)
-
addLogo
public Resource addLogo(ImageContent first, ImageContent... rest)
-
getSupportedViewingHintTypes
public Set<ViewingHint.Type> getSupportedViewingHintTypes()
-
getViewingHints
public List<ViewingHint> getViewingHints()
-
setViewingHints
public void setViewingHints(List<ViewingHint> viewingHints) throws IllegalArgumentException
Set the viewing hints for this resource.- Parameters:
viewingHints- list of viewing hints- Throws:
IllegalArgumentException- if the resources not not support one of the viewing hints.
-
addViewingHint
public Resource addViewingHint(ViewingHint first, ViewingHint... rest) throws IllegalArgumentException
Add one or more viewing hints for this resource.- Parameters:
first- first viewing hint to addrest- list of second and more viewing hints- Returns:
- this resource with added viewing hints
- Throws:
IllegalArgumentException- if the resources not not support one of the viewing hints.
-
getRelated
public List<OtherContent> getRelated()
-
setRelated
public void setRelated(List<OtherContent> related)
-
addRelated
public Resource addRelated(OtherContent first, OtherContent... rest)
-
getRenderings
public List<OtherContent> getRenderings()
-
setRenderings
public void setRenderings(List<OtherContent> renderings) throws IllegalArgumentException
Sets the renderings. All renderings must have both a profile and a format.- Parameters:
renderings- list of renderings with profile and format- Throws:
IllegalArgumentException- if at least one rendering does not have both a profile and a format.
-
addRendering
public Resource addRendering(OtherContent first, OtherContent... rest)
Add one or more renderings. All renderings must have both a profile and a format.- Parameters:
first- first renderingrest- list of other renderings- Returns:
- current instance
- Throws:
IllegalArgumentException- if at least one rendering does not have both a profile and a format.
-
verifyRendering
public void verifyRendering(OtherContent content)
-
getSeeAlso
public List<OtherContent> getSeeAlso()
-
setSeeAlso
public void setSeeAlso(List<OtherContent> seeAlso)
-
addSeeAlso
public Resource addSeeAlso(OtherContent first, OtherContent... rest)
-
isDefaultChoice
public boolean isDefaultChoice()
-
setIsDefaultChoice
public void setIsDefaultChoice(boolean is)
-
getAlternatives
public List<T> getAlternatives()
- Specified by:
getAlternativesin interfaceChoice<T>
-
setAlternatives
public void setAlternatives(List<T> alternatives)
- Specified by:
setAlternativesin interfaceChoice<T>
-
-