public abstract class CommonItem extends SharedItem implements Nameable, Removable
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
Constructor and Description |
---|
CommonItem(CommonData commonData) |
Modifier and Type | Method and Description |
---|---|
(package private) CommonData |
getData()
Get the
BasicData object that holds all data for this item. |
java.lang.String |
getDescription()
Get the description for the item.
|
java.lang.String |
getName()
Get the name of the item.
|
User |
getRemovedBy()
Get the user that flagged this item for removal.
|
boolean |
isRemoved()
Check if the removed flag is set for this item.
|
void |
setDescription(java.lang.String description)
Set the description for the item.
|
void |
setName(java.lang.String name)
Set the name of the item.
|
void |
setRemoved(boolean removed)
Set the removed flag for this item.
|
getItemKey, getProjectKey, initPermissions, isShared, onBeforeCommit, setItemKey, setProjectKey
getOwner, isOwner, setOwner, takeOwnership
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
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getId, getType, getVersion
checkPermission, getPermissions, hasPermission
getOwner, isOwner, setOwner, takeOwnership
CommonItem(CommonData commonData)
CommonData getData()
BasicItem
BasicData
object that holds all data for this item.getData
in class SharedItem
public java.lang.String getName()
Nameable
public void setName(java.lang.String name) throws PermissionDeniedException, InvalidDataException
Nameable
Nameable.MAX_NAME_LENGTH
constant.setName
in interface Nameable
name
- The new name for the itemPermissionDeniedException
- If the logged in user doesn't
have write permissionInvalidDataException
- If the name is null or longer
than specified by the Nameable.MAX_NAME_LENGTH
constantpublic java.lang.String getDescription()
Nameable
getDescription
in interface Nameable
String
with a description of the itempublic void setDescription(java.lang.String description) throws PermissionDeniedException, InvalidDataException
Nameable
Nameable.MAX_DESCRIPTION_LENGTH
constant.setDescription
in interface Nameable
description
- The new description for the itemPermissionDeniedException
- If the logged in user doesn't
have write permissionInvalidDataException
- If the description longer
than specified by the Nameable.MAX_DESCRIPTION_LENGTH
constantpublic boolean isRemoved()
Removable
public void setRemoved(boolean removed) throws PermissionDeniedException
Removable
setRemoved
in interface Removable
removed
- TRUE if the item should be flagged as removed,
FALSE otherwisePermissionDeniedException
- If the logged in user doesn't
have Permission.DELETE
permission for setting the flag
to TRUE or Permission.WRITE
permission for setting the
flag to FALSEpublic User getRemovedBy() throws PermissionDeniedException, ItemNotFoundException
Removable
getRemovedBy
in interface Removable
PermissionDeniedException
- If the logged in user doesn't have
Permission.READ
permission for the userItemNotFoundException
- If the user that removed this item
can't be found