Package net.sf.basedb.core
Class AnnotatedItem
- java.lang.Object
-
- net.sf.basedb.core.BasicItem
-
- net.sf.basedb.core.OwnedItem
-
- net.sf.basedb.core.SharedItem
-
- net.sf.basedb.core.CommonItem
-
- net.sf.basedb.core.AnnotatedItem
-
- All Implemented Interfaces:
AccessControlled
,Annotatable
,Identifiable
,Nameable
,Ownable
,Removable
,Shareable
- Direct Known Subclasses:
ArrayBatch
,ArrayDesign
,ArraySlide
,BioMaterial
,BioPlate
,DerivedBioAssay
,Experiment
,File
,Hardware
,ItemList
,Kit
,PhysicalBioAssay
,Plate
,PluginConfiguration
,Protocol
,RawBioAssay
,Software
,Tag
public abstract class AnnotatedItem extends CommonItem implements Annotatable
This is a helper class for items that need to implement theAnnotatable
interface. Most of those items should be able to extend this class.- Version:
- 2.0
- Author:
- Nicklas
- See Also:
Annotatable
- Last modified
- $Date: 2016-04-20 08:42:14 +0200 (on, 20 apr 2016) $
-
-
Field Summary
-
Fields inherited from interface net.sf.basedb.core.Nameable
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
-
-
Constructor Summary
Constructors Constructor Description AnnotatedItem(AnnotatedData annotatedData)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AnnotationSet
getAnnotationSet()
Get the annotation set containing the annotations for this item.(package private) AnnotatedData
getData()
Get theBasicData
object that holds all data for this item.Protocol
getProtocol()
Default implementation returns null.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 class net.sf.basedb.core.CommonItem
getDescription, getName, getRemovedBy, isRemoved, setDescription, setName, setRemoved
-
Methods inherited from class net.sf.basedb.core.SharedItem
getItemKey, getProjectKey, initPermissions, isShared, onBeforeCommit, setItemKey, setProjectKey
-
Methods inherited from class net.sf.basedb.core.OwnedItem
getOwner, isOwner, setOwner, takeOwnership
-
Methods inherited from class net.sf.basedb.core.BasicItem
addAnnotatableParents, addUsingItems, addUsingItems, breakCircularReferences, checkBatchAnnotatableUsage, checkPermission, equals, getBasicData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getUsingItems, getVersion, hashCode, hasPermission, isDetached, isInDatabase, isUsed, onAfterCommit, onAfterInsert, onRollback, setDbControl, setProjectDefaults, toString, validate
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.sf.basedb.core.AccessControlled
checkPermission, getPermissions, hasPermission
-
Methods inherited from interface net.sf.basedb.core.Annotatable
getAnnotatableParents
-
Methods inherited from interface net.sf.basedb.core.Identifiable
getId, getType, getVersion
-
Methods inherited from interface net.sf.basedb.core.Ownable
getOwner, isOwner, setOwner, takeOwnership
-
-
-
-
Constructor Detail
-
AnnotatedItem
AnnotatedItem(AnnotatedData annotatedData)
-
-
Method Detail
-
getData
AnnotatedData getData()
Description copied from class:BasicItem
Get theBasicData
object that holds all data for this item.- Overrides:
getData
in classCommonItem
-
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 whenDbControl.commit()
is called. To check if an item has annotations without creating a new annotation set use theAnnotatable.isAnnotated()
method.- Specified by:
getAnnotationSet
in interfaceAnnotatable
- Returns:
- An
AnnotationSet
- Throws:
PermissionDeniedException
- If the logged in user doesn't have enough permissionsBaseException
- 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 interfaceAnnotatable
- 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 interfaceAnnotatable
- Throws:
PermissionDeniedException
- If the logged in user doesn't have write permissionBaseException
- 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 interfaceAnnotatable
- Returns:
- Always null
- Since:
- 2.2
-
-