public class SnapshotManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.Integer,AnnotationSetSnapshot> |
snapshots |
Constructor and Description |
---|
SnapshotManager()
Create a new snapshot manager.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<AnnotationSnapshot> |
findAnnotations(DbControl dc,
Annotatable item,
Filter<? super AnnotationSnapshot> filter,
boolean searchInherited)
Utility method for calling
getSnapshot and findAnnotations
in one go. |
java.util.List<AnnotationSnapshot> |
findAnnotations(DbControl dc,
AnnotationSetSnapshot snapshot,
Filter<? super AnnotationSnapshot> filter,
boolean searchInherited)
Search in a snapshot for all annotations matching a given filter.
|
static java.lang.String |
getCacheKey(int annotationSetId)
The static cache key under which the snapshot for the
annotation set with the given id is cached.
|
AnnotationSetSnapshot |
getSnapshot(DbControl dc,
int annotationSetId)
Get the annotation snapshot for the annotation set with the given id.
|
static boolean |
removeSnapshot(int annotationSetId)
Removes a snapshot from the static cache.
|
private final java.util.Map<java.lang.Integer,AnnotationSetSnapshot> snapshots
public static java.lang.String getCacheKey(int annotationSetId)
annotationSetId
- The ID of an annotation setpublic static boolean removeSnapshot(int annotationSetId)
annotationSetId
- The ID of the annotation setpublic AnnotationSetSnapshot getSnapshot(DbControl dc, int annotationSetId)
dc
- A DbControl to use if the snapshot has to be created from
the database cacheannotationSetId
- The id of the annotation setpublic java.util.List<AnnotationSnapshot> findAnnotations(DbControl dc, AnnotationSetSnapshot snapshot, Filter<? super AnnotationSnapshot> filter, boolean searchInherited)
dc
- A DbControl to use for database access if a snapshot doesn't
exists for an inherited annotation setsnapshot
- The snapshot to searchfilter
- A filter that should match the wanted annotation snapshots
or null to match all annotationssearchInherited
- TRUE if inherited annotations should be searched,
FALSE to only search primary annotationspublic java.util.List<AnnotationSnapshot> findAnnotations(DbControl dc, Annotatable item, Filter<? super AnnotationSnapshot> filter, boolean searchInherited)
getSnapshot
and findAnnotations
in one go.getSnapshot(DbControl, int)
,
findAnnotations(DbControl, AnnotationSetSnapshot, Filter, boolean)