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
,FileServer
,Hardware
,ItemList
,Kit
,PhysicalBioAssay
,Plate
,PluginConfiguration
,Protocol
,RawBioAssay
,Software
,Tag
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:
- 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
-
Method Summary
Modifier and TypeMethodDescriptionGet the annotation set containing the annotations for this item.(package private) AnnotatedData
getData()
Get theBasicData
object that holds all data for this item.Default implementation returns null.boolean
Check if this item has an annotation set.void
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 Details
-
AnnotatedItem
AnnotatedItem(AnnotatedData annotatedData)
-
-
Method Details
-
getData
AnnotatedData getData()Description copied from class:BasicItem
Get theBasicData
object that holds all data for this item.- Overrides:
getData
in classCommonItem
-
getAnnotationSet
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
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
Default implementation returns null. Should be overriden by subclasses that has protocols.- Specified by:
getProtocol
in interfaceAnnotatable
- Returns:
- Always null
- Since:
- 2.2
-