Class AnnotationGenerator
- java.lang.Object
-
- org.dspace.app.iiif.model.generator.AnnotationGenerator
-
- All Implemented Interfaces:
IIIFResource
public class AnnotationGenerator extends Object implements IIIFResource
Generator for anannotationmodel. Annotations associate content resources and commentary with a canvas. This is used for theseeAlsoannotation and Search response.
-
-
Field Summary
Fields Modifier and Type Field Description static de.digitalcollections.iiif.model.MotivationCOMMENTINGstatic de.digitalcollections.iiif.model.MotivationLINKINGstatic de.digitalcollections.iiif.model.MotivationPAINTINGstatic StringTYPE
-
Constructor Summary
Constructors Constructor Description AnnotationGenerator(@NotNull String identifier)AnnotationGenerator(@NotNull String identifier, @NotNull de.digitalcollections.iiif.model.Motivation motivation)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description de.digitalcollections.iiif.model.sharedcanvas.Resource<de.digitalcollections.iiif.model.openannotation.Annotation>generateResource()Creates and returns a resource model.AnnotationGeneratorsetMotivation(@NotNull de.digitalcollections.iiif.model.Motivation motivation)Sets the motivation field.AnnotationGeneratorsetOnCanvas(CanvasGenerator canvas)Sets the canvas that is associated with this annotation.AnnotationGeneratorsetResource(ContentAsTextGenerator contentAsText)Sets a text resource for this annotation.AnnotationGeneratorsetResource(ExternalLinksGenerator otherContent)Sets an external link for this annotation.AnnotationGeneratorsetWithin(List<ManifestGenerator> within)Set the within property for this annotation.
-
-
-
Field Detail
-
TYPE
public static final String TYPE
- See Also:
- Constant Field Values
-
PAINTING
public static final de.digitalcollections.iiif.model.Motivation PAINTING
-
COMMENTING
public static final de.digitalcollections.iiif.model.Motivation COMMENTING
-
LINKING
public static final de.digitalcollections.iiif.model.Motivation LINKING
-
-
Method Detail
-
setMotivation
public AnnotationGenerator setMotivation(@NotNull @NotNull de.digitalcollections.iiif.model.Motivation motivation)
Sets the motivation field. Required.- Parameters:
motivation- the motivation- Returns:
-
setOnCanvas
public AnnotationGenerator setOnCanvas(CanvasGenerator canvas)
Sets the canvas that is associated with this annotation.- Parameters:
canvas-- Returns:
-
setResource
public AnnotationGenerator setResource(ContentAsTextGenerator contentAsText)
Sets a text resource for this annotation.- Parameters:
contentAsText-- Returns:
-
setResource
public AnnotationGenerator setResource(ExternalLinksGenerator otherContent)
Sets an external link for this annotation.- Parameters:
otherContent- external link generator- Returns:
-
setWithin
public AnnotationGenerator setWithin(List<ManifestGenerator> within)
Set the within property for this annotation. This property is a list of manifests. The property is renamed to partOf in v3Used by search result annotations.
- Parameters:
within-- Returns:
-
generateResource
public de.digitalcollections.iiif.model.sharedcanvas.Resource<de.digitalcollections.iiif.model.openannotation.Annotation> generateResource()
Description copied from interface:IIIFResourceCreates and returns a resource model.- Specified by:
generateResourcein interfaceIIIFResource- Returns:
- resource model
-
-