public interface

InstantAnnotationProvider

implements AnnotationProvider
com.pspdfkit.instant.annotations.InstantAnnotationProvider

Class Overview

Handles all annotation related operations on the owning Instant document. Retrieve it with getAnnotationProvider().

Summary

[Expand]
Inherited Fields
From interface com.pspdfkit.annotations.AnnotationProvider
Public Methods
abstract Annotation getAnnotationForIdentifier(String identifier)
Returns the annotation for the given identifier.
abstract String getIdentifierForAnnotation(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.
[Expand]
Inherited Methods
From interface com.pspdfkit.annotations.AnnotationProvider

Public Methods

public abstract Annotation getAnnotationForIdentifier (String identifier)

Returns the annotation for the given identifier.

Parameters
identifier An identifier obtained by calling getIdentifierForAnnotation(Annotation).
Returns
  • The annotation for the given identifier or null if no such annotation exists.

public abstract String getIdentifierForAnnotation (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(String).

Parameters
annotation The annotation for which the identifier should be returned.
Returns
  • A string uniquely identifying the given annotation in this document.
Throws
IllegalStateException when the annotation does not belong to this document.

public 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.