D
- Kind of annotated data the item is annotated with.public abstract class AnnotatedItem<D extends AnnotatedData> extends CommonItem<D> 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(D annotatedData) |
Modifier and Type | Method and Description |
---|---|
AnnotationSet |
getAnnotationSet()
Get the annotation set containing the annotations 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, getData, 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(D annotatedData)
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