Interface InstantAnnotationProvider
-
- All Implemented Interfaces:
-
com.pspdfkit.annotations.AnnotationProvider
public interface InstantAnnotationProvider implements AnnotationProvider
Handles all annotation related operations on the owning Instant document. Retrieve it with getAnnotationProvider.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enum
InstantAnnotationProvider.NonAnnotationChange
Possible non-annotation changes
public interface
InstantAnnotationProvider.OnNonAnnotationChangeListener
Object to be notified whenever a local non-annotation change happens.
-
Method Summary
Modifier and Type Method Description abstract Annotation
getAnnotationForIdentifier(@NonNull() String identifier)
Returns the annotation for the given identifier. abstract String
getIdentifierForAnnotation(@NonNull() Annotation annotation)
Returns the unique identifier used by Instant for the given annotation. abstract boolean
hasUnsavedChanges()
Returns whether there are unsaved changes to annotations in this document. abstract void
addNonAnnotationChangeListener(@NonNull() InstantAnnotationProvider.OnNonAnnotationChangeListener listener)
Registers the given object to be notified of non-annotation changes. -
-
Method Detail
-
getAnnotationForIdentifier
@Nullable() abstract Annotation getAnnotationForIdentifier(@NonNull() String identifier)
Returns the annotation for the given identifier.
- Parameters:
identifier
- An identifier obtained by calling getIdentifierForAnnotation.- Returns:
The annotation for the given identifier or
null
if no such annotation exists.
-
getIdentifierForAnnotation
@NonNull() abstract String getIdentifierForAnnotation(@NonNull() Annotation annotation)
Returns the unique identifier used by Instant for the given annotation.
The Instant identifier of an annotation is stable over time, so that it can be used to associate arbitrary data from separate sources with an annotation. The values generated by Instant are URL, XML, and file-system safe. They are unique within the context of the document, and can be used to retrieve the same annotation later by calling getAnnotationForIdentifier.
- Parameters:
annotation
- The annotation for which the identifier should be returned.- Returns:
A string uniquely identifying the given annotation in this document.
-
hasUnsavedChanges
abstract boolean hasUnsavedChanges()
Returns whether there are unsaved changes to annotations in this document.
- Returns:
true
if annotations were modified in this document and they should be synced with Instant Server (PSPDFKit Document Engine).
-
addNonAnnotationChangeListener
abstract void addNonAnnotationChangeListener(@NonNull() InstantAnnotationProvider.OnNonAnnotationChangeListener listener)
Registers the given object to be notified of non-annotation changes.
- Parameters:
listener
- The object to notify when a non-annotation change happens.
-
-
-
-