Class CanvasContent
- java.lang.Object
-
- info.freelibrary.iiif.presentation.v3.CanvasContent
-
- All Implemented Interfaces:
AnnotationBody<CanvasContent>
,ContentResource<CanvasContent>
,EmbeddedResource<CanvasContent>
,Localized<CanvasContent>
,Resource<CanvasContent>
public class CanvasContent extends Object implements AnnotationBody<CanvasContent>, EmbeddedResource<CanvasContent>, Resource<CanvasContent>
Canvas content that can be associated with aPaintingAnnotation
orSupplementingAnnotation
.
-
-
Constructor Summary
Constructors Constructor Description CanvasContent(String aID)
Creates a canvas content resource from the supplied ID.CanvasContent(URI aID)
Creates a canvas content resource from the supplied ID.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CanvasContent
addBehaviors(Behavior... aBehaviorArray)
Adds behaviors to the resource.CanvasContent
addBehaviors(List<Behavior> aBehaviorList)
Adds behaviors to the resource.CanvasContent
clearBehaviors()
Removes the behaviors associated with this resource.List<Behavior>
getBehaviors()
Gets the resource's behaviors in an unmodifiable list.Optional<MediaType>
getFormat()
Gets the media type format of the content resource.List<Homepage>
getHomepages()
Gets a list of resource homepages, initializing the list if this hasn't been done already.URI
getID()
Gets the ID.Label
getLabel()
Gets the label.List<String>
getLanguages()
Gets the content resource's languages.List<Metadata>
getMetadata()
Gets the metadata.List<PartOf>
getPartOfs()
Gets a list of resource partOfs, initializing the list if this hasn't been done already.List<Provider>
getProviders()
Gets a list of resource providers, initializing the list if this hasn't been done already.List<Rendering>
getRenderings()
Gets a list of resource renderings, initializing the list if this hasn't been done already.RequiredStatement
getRequiredStatement()
Gets the required statement.URI
getRights()
Gets the rights.List<SeeAlso>
getSeeAlsoRefs()
Gets see also reference(s).List<Service<?>>
getServices()
Gets a list of resource services, initializing the list if this hasn't been done already.Summary
getSummary()
Gets the summary.List<ContentResource<?>>
getThumbnails()
Gets a list of resource thumbnails, initializing the list if this hasn't been done already.String
getType()
Gets the type.CanvasContent
setBehaviors(Behavior... aBehaviorArray)
Sets the behaviors for this resource.CanvasContent
setBehaviors(List<Behavior> aBehaviorList)
Sets the behaviors for this resource.CanvasContent
setFormat(MediaType aMediaType)
Sets the format of the content resource.CanvasContent
setFormat(String aMediaType)
Sets the format of the resource from a file extension or media type.CanvasContent
setHomepages(Homepage... aHomepageArray)
Sets the homepages for this resource.CanvasContent
setHomepages(List<Homepage> aHomepageList)
Sets the homepages for this resource.CanvasContent
setID(String aID)
Sets the annotation body ID from its string form.CanvasContent
setID(URI aID)
Sets the annotation body ID.CanvasContent
setLabel(Label aLabel)
Sets the resource label.CanvasContent
setLabel(String aLabel)
Sets the resource label from the supplied string.CanvasContent
setMetadata(Metadata... aMetadataArray)
Sets the resource metadata.CanvasContent
setMetadata(List<Metadata> aMetadataList)
Sets the resource metadata.CanvasContent
setPartOfs(PartOf... aPartOfArray)
Sets the partOfs for this resource.CanvasContent
setPartOfs(List<PartOf> aPartOfList)
Sets the partOfs for this resource.CanvasContent
setProviders(Provider... aProviderArray)
Sets the providers for this resource.CanvasContent
setProviders(List<Provider> aProviderList)
Sets the providers for this resource.CanvasContent
setRenderings(Rendering... aRenderingArray)
Sets the renderings for this resource.CanvasContent
setRenderings(List<Rendering> aRenderingList)
Sets the renderings for this resource.CanvasContent
setRequiredStatement(RequiredStatement aStatement)
Sets the resource's required statement.CanvasContent
setRights(String aRights)
Sets the resource's rights URI from the supplied string.CanvasContent
setRights(URI aRights)
Sets the resource's rights URI.CanvasContent
setSeeAlsoRefs(SeeAlso... aSeeAlsoArray)
Sets see also reference(s).CanvasContent
setSeeAlsoRefs(List<SeeAlso> aSeeAlsoList)
Sets see also reference(s).CanvasContent
setServices(Service<?>... aServiceArray)
Sets the services for this resource.CanvasContent
setServices(List<Service<?>> aServiceList)
Sets the services for this resource.CanvasContent
setSummary(Summary aSummary)
Sets the resource summary.CanvasContent
setSummary(String aSummary)
Sets the resource summary.CanvasContent
setThumbnails(ContentResource<?>... aThumbnailArray)
Sets the thumbnails for this resource.CanvasContent
setThumbnails(List<ContentResource<?>> aThumbnailList)
Sets the thumbnails for this resource.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface info.freelibrary.iiif.presentation.v3.AnnotationBody
getID, getType
-
Methods inherited from interface info.freelibrary.iiif.presentation.v3.ContentResource
getFormat
-
Methods inherited from interface info.freelibrary.iiif.presentation.v3.EmbeddedResource
getID, getType
-
Methods inherited from interface info.freelibrary.iiif.presentation.v3.properties.Localized
setLanguages
-
Methods inherited from interface info.freelibrary.iiif.presentation.v3.Resource
getBehaviors, getHomepages, getID, getLabel, getMetadata, getPartOfs, getProviders, getRenderings, getRequiredStatement, getRights, getSeeAlsoRefs, getServices, getSummary, getThumbnails, getType
-
-
-
-
Constructor Detail
-
CanvasContent
public CanvasContent(String aID)
Creates a canvas content resource from the supplied ID.- Parameters:
aID
- A canvas content resource ID in string form
-
CanvasContent
public CanvasContent(URI aID)
Creates a canvas content resource from the supplied ID.- Parameters:
aID
- A canvas content resource ID
-
-
Method Detail
-
setFormat
public CanvasContent setFormat(String aMediaType)
Description copied from interface:ContentResource
Sets the format of the resource from a file extension or media type.- Specified by:
setFormat
in interfaceContentResource<CanvasContent>
- Parameters:
aMediaType
- A string representation of media type or file extension- Returns:
- The content resource
-
setFormat
public CanvasContent setFormat(MediaType aMediaType)
Description copied from interface:ContentResource
Sets the format of the content resource.- Specified by:
setFormat
in interfaceContentResource<CanvasContent>
- Parameters:
aMediaType
- A media type- Returns:
- The content resource
-
setProviders
public CanvasContent setProviders(Provider... aProviderArray)
Description copied from interface:Resource
Sets the providers for this resource.- Specified by:
setProviders
in interfaceResource<CanvasContent>
- Parameters:
aProviderArray
- The providers to set for this resource- Returns:
- The resource
-
setProviders
public CanvasContent setProviders(List<Provider> aProviderList)
Description copied from interface:Resource
Sets the providers for this resource.- Specified by:
setProviders
in interfaceResource<CanvasContent>
- Parameters:
aProviderList
- The providers to set for this resource- Returns:
- The resource
-
clearBehaviors
public CanvasContent clearBehaviors()
Description copied from interface:Resource
Removes the behaviors associated with this resource.- Specified by:
clearBehaviors
in interfaceResource<CanvasContent>
- Returns:
- The resource
-
setBehaviors
public CanvasContent setBehaviors(Behavior... aBehaviorArray)
Description copied from interface:Resource
Sets the behaviors for this resource. Different types of resources allow different types of behaviors. For instance, on aManifest
resource thesetBehaviors(Behavior aBehavior)
method only allows a ManifestBehavior to be passed. If a CollectionBehavior, for instance, is passed, anIllegalArgumentException
will be thrown. Manifests, collections, canvases, and ranges have their own behaviors. Other resources use theResourceBehavior
class.- Specified by:
setBehaviors
in interfaceResource<CanvasContent>
- Parameters:
aBehaviorArray
- The behaviors to set for this resource- Returns:
- The resource
-
setBehaviors
public CanvasContent setBehaviors(List<Behavior> aBehaviorList)
Description copied from interface:Resource
Sets the behaviors for this resource. Different types of resources allow different types of behaviors. For instance, on aManifest
resource thesetBehaviors(List<Behavior> aBehaviorList)
method only allows a ManifestBehavior to be passed. If a CollectionBehavior, for instance, is passed, anIllegalArgumentException
will be thrown. Manifests, collections, canvases, and ranges have their own behaviors. Other resources use theResourceBehavior
class.- Specified by:
setBehaviors
in interfaceResource<CanvasContent>
- Parameters:
aBehaviorList
- The behaviors to set for this resource- Returns:
- The resource
-
addBehaviors
public CanvasContent addBehaviors(Behavior... aBehaviorArray)
Description copied from interface:Resource
Adds behaviors to the resource.- Specified by:
addBehaviors
in interfaceResource<CanvasContent>
- Parameters:
aBehaviorArray
- An array of behaviors to add to the resource- Returns:
- The resource
-
addBehaviors
public CanvasContent addBehaviors(List<Behavior> aBehaviorList)
Description copied from interface:Resource
Adds behaviors to the resource.- Specified by:
addBehaviors
in interfaceResource<CanvasContent>
- Parameters:
aBehaviorList
- A list of behaviors to add to the resource- Returns:
- The resource
-
setSeeAlsoRefs
public CanvasContent setSeeAlsoRefs(SeeAlso... aSeeAlsoArray)
Description copied from interface:Resource
Sets see also reference(s).- Specified by:
setSeeAlsoRefs
in interfaceResource<CanvasContent>
- Parameters:
aSeeAlsoArray
- See also reference(s)- Returns:
- The resource
-
setSeeAlsoRefs
public CanvasContent setSeeAlsoRefs(List<SeeAlso> aSeeAlsoList)
Description copied from interface:Resource
Sets see also reference(s).- Specified by:
setSeeAlsoRefs
in interfaceResource<CanvasContent>
- Parameters:
aSeeAlsoList
- See also reference(s)- Returns:
- The resource
-
setServices
@SafeVarargs public final CanvasContent setServices(Service<?>... aServiceArray)
Description copied from interface:Resource
Sets the services for this resource.- Specified by:
setServices
in interfaceResource<CanvasContent>
- Parameters:
aServiceArray
- The services to set for this resource- Returns:
- The resource
-
setServices
public CanvasContent setServices(List<Service<?>> aServiceList)
Description copied from interface:Resource
Sets the services for this resource.- Specified by:
setServices
in interfaceResource<CanvasContent>
- Parameters:
aServiceList
- The services to set for this resource- Returns:
- The resource
-
setPartOfs
public CanvasContent setPartOfs(PartOf... aPartOfArray)
Description copied from interface:Resource
Sets the partOfs for this resource.- Specified by:
setPartOfs
in interfaceResource<CanvasContent>
- Parameters:
aPartOfArray
- The partOfs to set for this resource- Returns:
- The resource
-
setPartOfs
public CanvasContent setPartOfs(List<PartOf> aPartOfList)
Description copied from interface:Resource
Sets the partOfs for this resource.- Specified by:
setPartOfs
in interfaceResource<CanvasContent>
- Parameters:
aPartOfList
- The partOfs to set for this resource- Returns:
- The resource
-
setRenderings
public CanvasContent setRenderings(Rendering... aRenderingArray)
Description copied from interface:Resource
Sets the renderings for this resource.- Specified by:
setRenderings
in interfaceResource<CanvasContent>
- Parameters:
aRenderingArray
- The renderings to set for this resource- Returns:
- The resource
-
setRenderings
public CanvasContent setRenderings(List<Rendering> aRenderingList)
Description copied from interface:Resource
Sets the renderings for this resource.- Specified by:
setRenderings
in interfaceResource<CanvasContent>
- Parameters:
aRenderingList
- The renderings to set for this resource- Returns:
- The resource
-
setHomepages
public CanvasContent setHomepages(Homepage... aHomepageArray)
Description copied from interface:Resource
Sets the homepages for this resource.- Specified by:
setHomepages
in interfaceResource<CanvasContent>
- Parameters:
aHomepageArray
- The homepages to set for this resource- Returns:
- The resource
-
setHomepages
public CanvasContent setHomepages(List<Homepage> aHomepageList)
Description copied from interface:Resource
Sets the homepages for this resource.- Specified by:
setHomepages
in interfaceResource<CanvasContent>
- Parameters:
aHomepageList
- The homepages to set for this resource- Returns:
- The resource
-
setThumbnails
public CanvasContent setThumbnails(ContentResource<?>... aThumbnailArray)
Description copied from interface:Resource
Sets the thumbnails for this resource. A thumbnail can be any type of content resource, not justImageContent
.- Specified by:
setThumbnails
in interfaceResource<CanvasContent>
- Parameters:
aThumbnailArray
- The thumbnails to set for this resource- Returns:
- The resource
-
setThumbnails
public CanvasContent setThumbnails(List<ContentResource<?>> aThumbnailList)
Description copied from interface:Resource
Sets the thumbnails for this resource. A thumbnail can be any type of content resource, not justImageContent
.- Specified by:
setThumbnails
in interfaceResource<CanvasContent>
- Parameters:
aThumbnailList
- The thumbnails to set for this resource- Returns:
- The resource
-
setID
public CanvasContent setID(String aID)
Description copied from interface:AnnotationBody
Sets the annotation body ID from its string form.- Specified by:
setID
in interfaceAnnotationBody<CanvasContent>
- Specified by:
setID
in interfaceContentResource<CanvasContent>
- Specified by:
setID
in interfaceEmbeddedResource<CanvasContent>
- Specified by:
setID
in interfaceResource<CanvasContent>
- Parameters:
aID
- An annotation body's ID in string form- Returns:
- The annotation body
-
setID
public CanvasContent setID(URI aID)
Description copied from interface:AnnotationBody
Sets the annotation body ID.- Specified by:
setID
in interfaceAnnotationBody<CanvasContent>
- Specified by:
setID
in interfaceContentResource<CanvasContent>
- Specified by:
setID
in interfaceEmbeddedResource<CanvasContent>
- Specified by:
setID
in interfaceResource<CanvasContent>
- Parameters:
aID
- An annotation body's ID- Returns:
- The annotation body
-
setRights
public CanvasContent setRights(String aRights)
Description copied from interface:Resource
Sets the resource's rights URI from the supplied string.- Specified by:
setRights
in interfaceResource<CanvasContent>
- Parameters:
aRights
- A resource's rights URI in string form- Returns:
- The resource
-
setRights
public CanvasContent setRights(URI aRights)
Description copied from interface:Resource
Sets the resource's rights URI.- Specified by:
setRights
in interfaceResource<CanvasContent>
- Parameters:
aRights
- A rights URI- Returns:
- The resource
-
setRequiredStatement
public CanvasContent setRequiredStatement(RequiredStatement aStatement)
Description copied from interface:Resource
Sets the resource's required statement.- Specified by:
setRequiredStatement
in interfaceResource<CanvasContent>
- Parameters:
aStatement
- A required statement- Returns:
- The resource
-
setSummary
public CanvasContent setSummary(String aSummary)
Description copied from interface:Resource
Sets the resource summary.- Specified by:
setSummary
in interfaceResource<CanvasContent>
- Parameters:
aSummary
- A summary in string form- Returns:
- The resource
-
setSummary
public CanvasContent setSummary(Summary aSummary)
Description copied from interface:Resource
Sets the resource summary.- Specified by:
setSummary
in interfaceResource<CanvasContent>
- Parameters:
aSummary
- A resource's summary- Returns:
- The resource
-
setMetadata
public CanvasContent setMetadata(Metadata... aMetadataArray)
Description copied from interface:Resource
Sets the resource metadata.- Specified by:
setMetadata
in interfaceResource<CanvasContent>
- Parameters:
aMetadataArray
- An array of metadata properties- Returns:
- The resource
-
setMetadata
public CanvasContent setMetadata(List<Metadata> aMetadataList)
Description copied from interface:Resource
Sets the resource metadata.- Specified by:
setMetadata
in interfaceResource<CanvasContent>
- Parameters:
aMetadataList
- A list of metadata properties- Returns:
- The resource
-
setLabel
public CanvasContent setLabel(String aLabel)
Description copied from interface:Resource
Sets the resource label from the supplied string.- Specified by:
setLabel
in interfaceResource<CanvasContent>
- Parameters:
aLabel
- The string form of the label to set- Returns:
- The resource
-
setLabel
public CanvasContent setLabel(Label aLabel)
Description copied from interface:Resource
Sets the resource label.- Specified by:
setLabel
in interfaceResource<CanvasContent>
- Parameters:
aLabel
- The resource's label- Returns:
- The resource
-
getLanguages
public List<String> getLanguages()
Gets the content resource's languages.- Specified by:
getLanguages
in interfaceLocalized<T extends info.freelibrary.iiif.presentation.v3.AbstractResource<info.freelibrary.iiif.presentation.v3.AbstractContentResource<T>>>
- Returns:
- A list of languages
-
getFormat
public Optional<MediaType> getFormat()
Gets the media type format of the content resource.- Returns:
- The media type format of the content resource
-
getLabel
public Label getLabel()
Gets the label.- Returns:
- The label
-
getSummary
public Summary getSummary()
Gets the summary.- Returns:
- The summary
-
getThumbnails
public List<ContentResource<?>> getThumbnails()
Gets a list of resource thumbnails, initializing the list if this hasn't been done already.- Returns:
- The resource's thumbnails
-
getRequiredStatement
public RequiredStatement getRequiredStatement()
Gets the required statement.- Returns:
- The required statement
-
getRights
public URI getRights()
Gets the rights.- Returns:
- The rights
-
getHomepages
public List<Homepage> getHomepages()
Gets a list of resource homepages, initializing the list if this hasn't been done already.- Returns:
- The resource's homepages
-
getProviders
public List<Provider> getProviders()
Gets a list of resource providers, initializing the list if this hasn't been done already.- Returns:
- The resource's providers
-
getRenderings
public List<Rendering> getRenderings()
Gets a list of resource renderings, initializing the list if this hasn't been done already.- Returns:
- The resource's renderings
-
getID
public URI getID()
Gets the ID.- Returns:
- The ID
-
getPartOfs
public List<PartOf> getPartOfs()
Gets a list of resource partOfs, initializing the list if this hasn't been done already.- Returns:
- The resource's partOfs
-
getType
public String getType()
Gets the type.- Returns:
- The type
-
getBehaviors
public List<Behavior> getBehaviors()
Gets the resource's behaviors in an unmodifiable list.- Returns:
- The resource's behaviors
-
getSeeAlsoRefs
public List<SeeAlso> getSeeAlsoRefs()
Gets see also reference(s).- Returns:
- The see also reference(s)
-
-