2.17.2: 2011-06-17

net.sf.basedb.core
Interface Annotatable

All Superinterfaces:
AccessControlled, Identifiable
All Known Subinterfaces:
AnnotatableProxy
All Known Implementing Classes:
AnnotatedItem, ArrayBatch, ArrayDesign, ArraySlide, BioAssay, BioAssaySet, BioMaterial, BioPlate, BioSource, Extract, Hybridization, LabeledExtract, MeasuredBioMaterial, Plate, PluginConfiguration, PluginDefinition, Protocol, RawBioAssay, Sample, Scan, Well

public interface Annotatable
extends Identifiable

This interface is implemented by all items which can be annotated. Annotations are extra values attached to an item. Usually these values are used in the analysis of an experiment.

Version:
2.0
Author:
Nicklas
See Also:
AnnotationSet, Annotation, AnnotationType
Last modified
$Date: 2009-04-06 14:52:39 +0200 (Mon, 06 Apr 2009) $

Method Summary
 Set<Annotatable> getAnnotatableParents()
          Get all parents objects which are annotatable and the logged in user has read permission to.
 AnnotationSet getAnnotationSet()
          Get the annotation set containing the annotations for this item.
 Protocol getProtocol()
          A protcol used in the creation of an item that is used to attach annotations for the protocol parameters.
 boolean isAnnotated()
          Check if this item has an annotation set.
 void removeAnnotations()
          Remove all annotations from this item, by deleting the annotation set.
 
Methods inherited from interface net.sf.basedb.core.Identifiable
getId, getType, getVersion
 
Methods inherited from interface net.sf.basedb.core.AccessControlled
checkPermission, getPermissions, hasPermission
 

Method Detail

getAnnotationSet

AnnotationSet getAnnotationSet()
                               throws PermissionDeniedException,
                                      BaseException
Get the annotation set containing the annotations for this item. If the item doesn't have any annotations a new annotation set is created and automatically saved to the database when DbControl.commit() is called. To check if an item has annotations without creating a new annotation set use the isAnnotated() method.

Returns:
An AnnotationSet
Throws:
PermissionDeniedException - If the logged in user doesn't have enough permissions
BaseException - If there is another error

isAnnotated

boolean isAnnotated()
Check if this item has an annotation set. The annotation set may be empty.

Returns:
TRUE if an annotation set exists, FALSE otherwise

removeAnnotations

void removeAnnotations()
                       throws PermissionDeniedException,
                              BaseException
Remove all annotations from this item, by deleting the annotation set.

Throws:
PermissionDeniedException - If the logged in user doesn't have write permission
BaseException - If there is another error

getAnnotatableParents

Set<Annotatable> getAnnotatableParents()
                                       throws BaseException
Get all parents objects which are annotatable and the logged in user has read permission to. If the item doesn't have any annotatable parents, it may return null or an empty set. The method should only return the immediate parent(s), not parents to parents, etc.

Returns:
A set containing annotatable items, or null
Throws:
BaseException - If there is an error

getProtocol

Protocol getProtocol()
A protcol used in the creation of an item that is used to attach annotations for the protocol parameters.

Returns:
A protocol or null if the protocol is unknown
Since:
2.2

2.17.2: 2011-06-17