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

Nested Classes
enum InstantAnnotationProvider.NonAnnotationChange Possible non-annotation changes  
interface InstantAnnotationProvider.OnNonAnnotationChangeListener Object to be notified whenever a local non-annotation change happens. 
[Expand]
Inherited Fields
From interface com.pspdfkit.annotations.AnnotationProvider
Public Methods
abstract void addNonAnnotationChangeListener(InstantAnnotationProvider.OnNonAnnotationChangeListener listener)
Registers the given object to be notified of non-annotation changes.
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 void addNonAnnotationChangeListener (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.

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.