Class DefaultAnnotationReference
- java.lang.Object
-
- io.annot8.implementations.support.references.AbstractAnnotationReference
-
- io.annot8.implementations.reference.references.DefaultAnnotationReference
-
- All Implemented Interfaces:
io.annot8.api.references.AnnotationReference
public class DefaultAnnotationReference extends AbstractAnnotationReference
A reference which will always retrieve the latest annotation from the appropriate annotation store.Does not hold a reference to the group.
-
-
Constructor Summary
Constructors Constructor Description DefaultAnnotationReference(io.annot8.api.data.Item item, String contentId, String annotationId)New reference either from another reference or manually created.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAnnotationId()StringgetContentId()static DefaultAnnotationReferenceto(io.annot8.api.data.Item item, io.annot8.api.annotations.Annotation annotation)Create an annotation reference for the annotation.Optional<io.annot8.api.annotations.Annotation>toAnnotation()-
Methods inherited from class io.annot8.implementations.support.references.AbstractAnnotationReference
equals, hashCode, toString
-
-
-
-
Constructor Detail
-
DefaultAnnotationReference
public DefaultAnnotationReference(io.annot8.api.data.Item item, String contentId, String annotationId)New reference either from another reference or manually created.- Parameters:
annotationId- the annotation idcontentId- the content iditem- the item (which owns the content)
-
-
Method Detail
-
to
public static DefaultAnnotationReference to(io.annot8.api.data.Item item, io.annot8.api.annotations.Annotation annotation)
Create an annotation reference for the annotation.- Parameters:
annotation- the annotationitem- the item owning the annotation- Returns:
- reference to the annotation
-
getAnnotationId
public String getAnnotationId()
-
getContentId
public String getContentId()
-
toAnnotation
public Optional<io.annot8.api.annotations.Annotation> toAnnotation()
-
-