net.sf.basedb.core
Class AnnotatedItem<D extends AnnotatedData>
java.lang.Object
net.sf.basedb.core.BasicItem<D>
net.sf.basedb.core.OwnedItem<D>
net.sf.basedb.core.SharedItem<D>
net.sf.basedb.core.CommonItem<D>
net.sf.basedb.core.AnnotatedItem<D>
- Type Parameters:
D
- Kind of annotated data the item is annotated with.
- All Implemented Interfaces:
- AccessControlled, Annotatable, Identifiable, Nameable, Ownable, Removable, Shareable
- Direct Known Subclasses:
- ArrayBatch, ArrayDesign, ArraySlide, BioMaterial, BioPlate, Hybridization, Plate, PluginConfiguration, Protocol, RawBioAssay, Scan
public abstract class AnnotatedItem<D extends AnnotatedData>
- extends CommonItem<D>
- implements Annotatable
This is a helper class for items that need to implement the
Annotatable
interface. Most of those items should
be able to extend this class.
- Version:
- 2.0
- Author:
- Nicklas
- See Also:
Annotatable
- Last modified
- $Date: 2009-04-06 14:52:39 +0200 (Mon, 06 Apr 2009) $
Methods inherited from class net.sf.basedb.core.BasicItem |
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getUsingItems, getVersion, hashCode, hasPermission, isDetached, isInDatabase, isUsed, onAfterCommit, onAfterInsert, onRollback, setDbControl, setProjectDefaults, toString, toTransferable, validate |
AnnotatedItem
AnnotatedItem(D annotatedData)
getAnnotationSet
public AnnotationSet getAnnotationSet()
throws PermissionDeniedException,
BaseException
- Description copied from interface:
Annotatable
- 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 Annotatable.isAnnotated()
method.
- Specified by:
getAnnotationSet
in interface Annotatable
- Returns:
- An
AnnotationSet
- Throws:
PermissionDeniedException
- If the logged in user doesn't have
enough permissions
BaseException
- If there is another error
isAnnotated
public boolean isAnnotated()
- Description copied from interface:
Annotatable
- Check if this item has an annotation set. The annotation set may be
empty.
- Specified by:
isAnnotated
in interface Annotatable
- Returns:
- TRUE if an annotation set exists, FALSE otherwise
removeAnnotations
public void removeAnnotations()
throws PermissionDeniedException,
BaseException
- Description copied from interface:
Annotatable
- Remove all annotations from this item, by deleting the annotation set.
- Specified by:
removeAnnotations
in interface Annotatable
- Throws:
PermissionDeniedException
- If the logged in user doesn't have
write permission
BaseException
- If there is another error
getProtocol
public Protocol getProtocol()
- Default implementation returns null. Should be overriden by subclasses
that has protocols.
- Specified by:
getProtocol
in interface Annotatable
- Returns:
- Always null
- Since:
- 2.2
toTransferable
AnnotatedItemInfo toTransferable(AnnotatedItemInfo info)
- Since:
- 2.5