public abstract class AnnotatedItem extends CommonItem implements Annotatable
Annotatable
interface. Most of those items should
be able to extend this class.Annotatable
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
Constructor and Description |
---|
AnnotatedItem(AnnotatedData annotatedData) |
Modifier and Type | Method and Description |
---|---|
AnnotationSet |
getAnnotationSet()
Get the annotation set containing the annotations for this item.
|
(package private) AnnotatedData |
getData()
Get the
BasicData 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.
|
getDescription, getName, isRemoved, setDescription, setName, setRemoved
getItemKey, getProjectKey, initPermissions, isShared, onBeforeCommit, setItemKey, setProjectKey
getOwner, isOwner, setOwner, takeOwnership
addUsingItems, addUsingItems, checkPermission, equals, getBasicData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getUsingItems, getVersion, hashCode, hasPermission, isDetached, isInDatabase, isUsed, onAfterCommit, onAfterInsert, onRollback, setDbControl, setProjectDefaults, toString, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getAnnotatableParents
getId, getType, getVersion
checkPermission, getPermissions, hasPermission
getOwner, isOwner, setOwner, takeOwnership
AnnotatedItem(AnnotatedData annotatedData)
AnnotatedData getData()
BasicItem
BasicData
object that holds all data for this item.getData
in class CommonItem
public AnnotationSet getAnnotationSet() throws PermissionDeniedException, BaseException
Annotatable
DbControl.commit()
is
called. To check if an item has annotations without creating a new
annotation set use the Annotatable.isAnnotated()
method.getAnnotationSet
in interface Annotatable
AnnotationSet
PermissionDeniedException
- If the logged in user doesn't have
enough permissionsBaseException
- If there is another errorpublic boolean isAnnotated()
Annotatable
isAnnotated
in interface Annotatable
public void removeAnnotations() throws PermissionDeniedException, BaseException
Annotatable
removeAnnotations
in interface Annotatable
PermissionDeniedException
- If the logged in user doesn't have
write permissionBaseException
- If there is another errorpublic Protocol getProtocol()
getProtocol
in interface Annotatable