Package net.sf.basedb.core
Class AnnotationTypeCategory
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.AnnotationTypeCategory
- All Implemented Interfaces:
AccessControlled
,Identifiable
,Nameable
,Ownable
,Registered
,Removable
,Shareable
Objects of this class defines an annotation type category.
The categories are used to group related
AnnotationType
:s.
An annotation type can belong to more than one category.
- Version:
- 2.0
- Author:
- Dominic Oyeniran
- See Also:
- Last modified
- $Date: 2006-05-11 (Thu, 11 May 2006) $
-
Field Summary
Fields inherited from interface net.sf.basedb.core.Nameable
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
-
Constructor Summary
ConstructorDescriptionAnnotationTypeCategory
(AnnotationTypeCategoryData annotationTypeCategoryData) -
Method Summary
Modifier and TypeMethodDescriptiongetAnnotationTypes
(Item itemType) Gets a query that returns the annotation types that are members of this categorystatic AnnotationTypeCategory
Get anAnnotationTypeCategory
item when you know the id.(package private) AnnotationTypeCategoryData
getData()
Get theBasicData
object that holds all data for this item.Get the date that the item was registered in the database.Get the item subtype that is linked to this category of annotations.static AnnotationTypeCategory
Creates a newAnnotationTypeCategory
item.static ItemQuery<AnnotationTypeCategory>
getQuery()
Get aItemQuery
object configured to retrieveAnnotationTypeCategory
items.A short name can be used in some places instead of the normal name.Short-cut for calling getItemSubtype().getSubCategoriesAnnotationType().<T> List<T>
Short-cut for calling getSubCategoriesAnnotationType().getValues()Short-cut for calling getSubCategoriesAnnotationType().getValueType()<T> List<T>
Get the list of values that are used to match this category.getType()
Get the type of item represented by the object.boolean
Checks if the given annotation type is a member in this category.void
setEntryDate
(Date entryDate) Set the date the entry was registered in the database.void
setItemSubtype
(ItemSubtype subtype) Set the item subtype that is linked to this category of annotations.void
setShortName
(String shortName) Set the short name.void
setSubCategoryValues
(List<?> values) Set the list of values that should be used to match sub-categories.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.Identifiable
getId, getVersion
Methods inherited from interface net.sf.basedb.core.Ownable
getOwner, isOwner, setOwner, takeOwnership
-
Field Details
-
TYPE
The type of item represented by this class.- See Also:
-
-
Constructor Details
-
AnnotationTypeCategory
AnnotationTypeCategory(AnnotationTypeCategoryData annotationTypeCategoryData)
-
-
Method Details
-
getNew
Creates a newAnnotationTypeCategory
item.- Parameters:
dc
- TheDbControl
which will be used for permission checking and database access- Returns:
- The new
AnnotationType
item - Throws:
BaseException
- If there is an error
-
getById
public static AnnotationTypeCategory getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException Get anAnnotationTypeCategory
item when you know the id.- Parameters:
dc
- TheDbControl
which will be used for permission checking and database accessid
- The id of the item to load- Returns:
- The
AnnotationTypeCategory
item - Throws:
ItemNotFoundException
- If an item with the specified id is not foundPermissionDeniedException
- If the logged in user doesn't havePermission.READ
permission to the itemBaseException
- If there is another error
-
getQuery
Get aItemQuery
object configured to retrieveAnnotationTypeCategory
items.- Returns:
- An
ItemQuery
object
-
getData
AnnotationTypeCategoryData getData()Description copied from class:BasicItem
Get theBasicData
object that holds all data for this item.- Overrides:
getData
in classCommonItem
-
getType
Description copied from interface:Identifiable
Get the type of item represented by the object. The returned value is one of the values defined in theItem
enumeration.- Specified by:
getType
in interfaceIdentifiable
- Returns:
- A value indicating the type of item
-
getEntryDate
Description copied from interface:Registered
Get the date that the item was registered in the database.- Specified by:
getEntryDate
in interfaceRegistered
- Returns:
- A date or null if this is not known
-
setEntryDate
Description copied from interface:Registered
Set the date the entry was registered in the database. Implementations should only allow this property to be set before the item is first stored in the database. The intention of this method is to facilitate export/import of data between server.- Specified by:
setEntryDate
in interfaceRegistered
- Parameters:
entryDate
- A date or null to use today's date
-
getShortName
A short name can be used in some places instead of the normal name.- Since:
- 3.20
-
setShortName
Set the short name.- Since:
- 3.20
-
getItemSubtype
Get the item subtype that is linked to this category of annotations.- Since:
- 3.20
-
setItemSubtype
Set the item subtype that is linked to this category of annotations.- Since:
- 3.20
-
getSubCategoriesAnnotationType
Short-cut for calling getItemSubtype().getSubCategoriesAnnotationType().- Since:
- 3.20
-
getSubCategoriesValueType
Short-cut for calling getSubCategoriesAnnotationType().getValueType()- Since:
- 3.20
-
getSubCategoriesEnumeration
Short-cut for calling getSubCategoriesAnnotationType().getValues()- Since:
- 3.20
-
getSubCategoryValues
Get the list of values that are used to match this category.- Throws:
BaseException
- Since:
- 3.20
-
setSubCategoryValues
public void setSubCategoryValues(List<?> values) throws PermissionDeniedException, InvalidDataException Set the list of values that should be used to match sub-categories. The list of values must be taken from the annotation type that is used as the sub-category annotation type on the associated item subtype.- Throws:
PermissionDeniedException
InvalidDataException
- Since:
- 3.20
- See Also:
-
getAnnotationTypes
Gets a query that returns the annotation types that are members of this category- Parameters:
itemType
- Optional, limit the annotation types to those that are enabled for the specified item- Returns:
- An
ItemQuery
object
-
isInCategory
Checks if the given annotation type is a member in this category.- Since:
- 3.20
-