2.17.2: 2011-06-17

net.sf.basedb.core
Enum Item

java.lang.Object
  extended by java.lang.Enum<Item>
      extended by net.sf.basedb.core.Item
All Implemented Interfaces:
Serializable, Comparable<Item>

public enum Item
extends Enum<Item>

This class defines constants for various items in BASE.

Version:
2.0
Author:
Samuel
Last modified
$Date: 2010-12-02 14:35:04 +0100 (Thu, 02 Dec 2010) $

Nested Class Summary
private static class Item.DefinedPermissions
          Helper class to make it easier to set up the defined permissions.
 
Enum Constant Summary
ANNOTATION
          The item is an Annotation.
ANNOTATIONSET
          The item is an AnnotationSet.
ANNOTATIONTYPE
          The item is an AnnotationType.
ANNOTATIONTYPECATEGORY
          The item is an AnnotationTypeCategory.
ANYTOANY
          The item is an AnyToAny link.
ARRAYBATCH
          The item is an ArrayBatch.
ARRAYDESIGN
          The item is an ArrayDesign.
ARRAYDESIGNBLOCK
          The item is an ArrayDesignBlock.
ARRAYDESIGNPLATE
          The item is a ArrayDesignPlate connecter.
ARRAYSLIDE
          The item is an ArraySlide.
BIOASSAY
          The item is a BioAssay
BIOASSAYSET
          The item is a BioAssaySet
BIOMATERIALEVENT
          The item is a BioMaterialEvent.
BIOMATERIALLIST
          The item is a BioMaterialList
BIOPLATE
          The item is a BioPlate
BIOPLATEEVENT
          The item is a BioPlateEvent
BIOPLATEEVENTPARTICIPANT
          The item is a BioPlateEventParticipant
BIOPLATEEVENTTYPE
          The item is a BioPlateEventType
BIOPLATETYPE
          The item is a BioPlateType.
BIOSOURCE
          The item is a BioSource.
BIOWELL
          The item is a BioWell
CHANGEHISTORY
          The item is a ChangeHistory entry.
CLIENT
          The item is an Client.
CLIENTDEFAULTSETTING
          The item is an ClientDefaultSetting.
DATACUBE
          The item is a DataCube
DATACUBECOLUMN
          The item is a DataCubeColumn
DATACUBEEXTRAVALUE
          The item is a DataCubeExtraValue
DATACUBEFILTER
          The item is a DataCubeFilter
DATACUBELAYER
          The item is a DataCubeLayer
DATAFILETYPE
          The item is a DataFileType
DIRECTORY
          The item is a Directory.
DISKUSAGE
          The item is a DiskUsage.
EXPERIMENT
          The item is an Experiment
EXTRACT
          The item is an Extract.
EXTRAVALUE
          The item is an ExtraValue
EXTRAVALUETYPE
          The item is an ExtraValueType
FEATURE
          The item is a Feature.
FILE
          The item is a File.
FILESERVER
          The item is a FileServer.
FILESET
          The item is a FileSet
FILESETMEMBER
          The item is a FileSetMember
FILETYPE
          The item is a FileType.
FORMULA
          The item is a Formula
GLOBALDEFAULTSETTING
          The item is an GlobalDefaultSetting.
GROUP
          The item is a Group.
HARDWARE
          The item is a Hardware.
HARDWARETYPE
          The item is a HardwareType.
HELP
          The item is a Help.
HYBRIDIZATION
          The item is a Hybridization.
IMAGE
          The item is an Image.
ITEMKEY
          The item is an ItemKey.
JOB
          The item is a Job
JOBAGENT
          The item is a JobAgent
JOBAGENTSETTINGS
          The item is a JobAgentSettings
LABEL
          The item is a Label.
LABELEDEXTRACT
          The item is a LabeledExtract.
MESSAGE
          The item is a Message.
MIMETYPE
          The item is a MimeType.
NEWS
          The item is a News.
PERMISSIONTEMPLATE
          The item is a PermissionTemplate.
PLATE
          The item is a Plate.
PLATEEVENT
          The item is a PlateEvent.
PLATEEVENTTYPE
          The item is a PlateEventType.
PLATEGEOMETRY
          The item is a PlateGeometry.
PLATEMAPPING
          The item is a PlateMapping.
PLATETYPE
          The item is a PlateType.
PLATFORM
          The item is a Platform
PLATFORMFILETYPE
          The item is a PlatformFileType
PLATFORMVARIANT
          The item is a PlatformVariant
PLUGINCONFIGURATION
          The item is a PluginConfiguration
PLUGINDEFINITION
          The item is a PluginDefinition
PLUGINTYPE
          The item is a PluginType
PROJECT
          The item is a Project.
PROJECTKEY
          The item is a ProjectKey.
PROTOCOL
          The item is a Protocol.
PROTOCOLTYPE
          The item is a ProtocolType.
QUANTITY
          The item is a Quantity.
QUOTA
          The item is a Quota.
QUOTATYPE
          The item is a QuotaType.
RAWBIOASSAY
          The item is a RawBioAssay.
RAWDATA
          The item is a RawData spot.
REPORTER
          The item is a Reporter.
REPORTERLIST
          The item is a ReporterType.
REPORTERSCORE
          The item is a ReporterScore.
REPORTERTYPE
          The item is a ReporterType.
ROLE
          The item is a Role.
ROLEKEY
          The item is a RoleKey.
SAMPLE
          The item is a Sample.
SCAN
          The item is a Scan.
SESSION
          The item is an Session.
SETTING
          The item is an Setting.
SOFTWARE
          The item is a Software.
SOFTWARETYPE
          The item is a SoftwareType.
SPOTDATA
          Representing spot data, not an actual item.
SPOTIMAGES
          The item is a SpotImages.
SYSTEM
          Not an item as susch.
TRANSFORMATION
          The item is a Transformation
UNIT
          The item is a Unit.
USER
          The item is a User.
USERCLIENTSETTING
          The item is an UserClientSetting.
USERDEFAULTSETTING
          The item is an UserDefaultSetting.
VIRTUALDB
          The item is a VirtualDb
WELL
          The item is a Well.
 
Field Summary
private  String alias
           
private static Map<String,Item> aliasMapping
           
private  Constructor<? extends BasicItem> constructor
           
private  Class<? extends BasicData> dataClass
           
private static Map<Class<? extends BasicData>,Item> dataClassMapping
           
private  Set<Permission> definedPermissions
           
static Comparator<Identifiable> DELETION_ORDER
           
private  float deletionOrder
           
private  String displayValue
           
private  Method getById
           
private  Class<? extends BasicItem> itemClass
           
private static Map<Class<? extends BasicItem>,Item> itemClassMapping
           
(package private) static int MAX_VALUE
           
private  int value
           
private static Map<Integer,Item> valueMapping
           
 
Method Summary
static Item fromClass(Class<?> anyClass)
          Get the Item object when you know either the item or data class.
static Item fromDataClass(Class<? extends BasicData> dataClass)
          Get the Item object when you know the data class.
static Item fromDataObject(BasicData data)
          Get the Item object when you have a data layer object.
static Item fromItemClass(Class<? extends BasicItem> itemClass)
          Get the Item object when you know the item class.
static Item fromValue(int value)
          Get the Item object when you know the integer code.
 String getAlias()
          Get the alias for this item, which is used in queries,
 BasicItem getById(DbControl dc, int id)
          Get the item of the type represented by this enumeration constant with the specified id.
(package private)  Constructor<? extends BasicItem> getConstructor()
          Get the default constructor for new objects of this type.
 Class<? extends BasicData> getDataClass()
          Get the data object that is used to store information in the database for items of this type.
 Set<Permission> getDefinedPermissions()
          Get the permissions which are meaningful to assign to an item if this type.
 float getDeletionOrder()
          Get a value indicating the deletion order.
 Class<? extends BasicItem> getItemClass()
          Get the class object that is used to handle items of this type.
 int getValue()
          Get the integer value that is used when storing an item to the database.
 String toString()
           
static Item valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Item[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

SYSTEM

public static final Item SYSTEM
Not an item as susch. Used for setting system permissions to role keys.

See Also:
Install, SessionControl.hasSystemPermission(Permission)

USER

public static final Item USER
The item is a User.


GROUP

public static final Item GROUP
The item is a Group.


ROLE

public static final Item ROLE
The item is a Role.


PROJECT

public static final Item PROJECT
The item is a Project.


ITEMKEY

public static final Item ITEMKEY
The item is an ItemKey.


PROJECTKEY

public static final Item PROJECTKEY
The item is a ProjectKey.


ROLEKEY

public static final Item ROLEKEY
The item is a RoleKey.


PERMISSIONTEMPLATE

public static final Item PERMISSIONTEMPLATE
The item is a PermissionTemplate.


CLIENT

public static final Item CLIENT
The item is an Client.


HELP

public static final Item HELP
The item is a Help.


SESSION

public static final Item SESSION
The item is an Session.


SETTING

public static final Item SETTING
The item is an Setting.


GLOBALDEFAULTSETTING

public static final Item GLOBALDEFAULTSETTING
The item is an GlobalDefaultSetting.


USERDEFAULTSETTING

public static final Item USERDEFAULTSETTING
The item is an UserDefaultSetting.


CLIENTDEFAULTSETTING

public static final Item CLIENTDEFAULTSETTING
The item is an ClientDefaultSetting.


USERCLIENTSETTING

public static final Item USERCLIENTSETTING
The item is an UserClientSetting.


QUOTA

public static final Item QUOTA
The item is a Quota.


QUOTATYPE

public static final Item QUOTATYPE
The item is a QuotaType.


DISKUSAGE

public static final Item DISKUSAGE
The item is a DiskUsage.


FILE

public static final Item FILE
The item is a File.


FILETYPE

public static final Item FILETYPE
The item is a FileType.


DIRECTORY

public static final Item DIRECTORY
The item is a Directory.


MIMETYPE

public static final Item MIMETYPE
The item is a MimeType.


FILESERVER

public static final Item FILESERVER
The item is a FileServer.


PROTOCOL

public static final Item PROTOCOL
The item is a Protocol.


PROTOCOLTYPE

public static final Item PROTOCOLTYPE
The item is a ProtocolType.


HARDWARE

public static final Item HARDWARE
The item is a Hardware.


HARDWARETYPE

public static final Item HARDWARETYPE
The item is a HardwareType.


SOFTWARE

public static final Item SOFTWARE
The item is a Software.


SOFTWARETYPE

public static final Item SOFTWARETYPE
The item is a SoftwareType.


NEWS

public static final Item NEWS
The item is a News.


MESSAGE

public static final Item MESSAGE
The item is a Message.


ANYTOANY

public static final Item ANYTOANY
The item is an AnyToAny link.


CHANGEHISTORY

public static final Item CHANGEHISTORY
The item is a ChangeHistory entry.


REPORTER

public static final Item REPORTER
The item is a Reporter.


REPORTERTYPE

public static final Item REPORTERTYPE
The item is a ReporterType.


REPORTERLIST

public static final Item REPORTERLIST
The item is a ReporterType.


REPORTERSCORE

public static final Item REPORTERSCORE
The item is a ReporterScore. This item is not a BasicItem.


ANNOTATIONSET

public static final Item ANNOTATIONSET
The item is an AnnotationSet.


ANNOTATION

public static final Item ANNOTATION
The item is an Annotation.


ANNOTATIONTYPE

public static final Item ANNOTATIONTYPE
The item is an AnnotationType.


ANNOTATIONTYPECATEGORY

public static final Item ANNOTATIONTYPECATEGORY
The item is an AnnotationTypeCategory.


QUANTITY

public static final Item QUANTITY
The item is a Quantity.


UNIT

public static final Item UNIT
The item is a Unit.


BIOSOURCE

public static final Item BIOSOURCE
The item is a BioSource.


SAMPLE

public static final Item SAMPLE
The item is a Sample.


EXTRACT

public static final Item EXTRACT
The item is an Extract.


LABELEDEXTRACT

public static final Item LABELEDEXTRACT
The item is a LabeledExtract.


BIOMATERIALEVENT

public static final Item BIOMATERIALEVENT
The item is a BioMaterialEvent.


LABEL

public static final Item LABEL
The item is a Label.


BIOPLATE

public static final Item BIOPLATE
The item is a BioPlate


BIOWELL

public static final Item BIOWELL
The item is a BioWell


BIOMATERIALLIST

public static final Item BIOMATERIALLIST
The item is a BioMaterialList


BIOPLATETYPE

public static final Item BIOPLATETYPE
The item is a BioPlateType.

Since:
2.16

BIOPLATEEVENT

public static final Item BIOPLATEEVENT
The item is a BioPlateEvent

Since:
2.17

BIOPLATEEVENTPARTICIPANT

public static final Item BIOPLATEEVENTPARTICIPANT
The item is a BioPlateEventParticipant

Since:
2.17

BIOPLATEEVENTTYPE

public static final Item BIOPLATEEVENTTYPE
The item is a BioPlateEventType

Since:
2.17

PLATEGEOMETRY

public static final Item PLATEGEOMETRY
The item is a PlateGeometry.


PLATE

public static final Item PLATE
The item is a Plate.


PLATETYPE

public static final Item PLATETYPE
The item is a PlateType.


PLATEEVENT

public static final Item PLATEEVENT
The item is a PlateEvent.


PLATEEVENTTYPE

public static final Item PLATEEVENTTYPE
The item is a PlateEventType.


WELL

public static final Item WELL
The item is a Well.


PLATEMAPPING

public static final Item PLATEMAPPING
The item is a PlateMapping.


ARRAYDESIGN

public static final Item ARRAYDESIGN
The item is an ArrayDesign.


ARRAYBATCH

public static final Item ARRAYBATCH
The item is an ArrayBatch.


ARRAYSLIDE

public static final Item ARRAYSLIDE
The item is an ArraySlide.


ARRAYDESIGNBLOCK

public static final Item ARRAYDESIGNBLOCK
The item is an ArrayDesignBlock.


FEATURE

public static final Item FEATURE
The item is a Feature.


ARRAYDESIGNPLATE

public static final Item ARRAYDESIGNPLATE
The item is a ArrayDesignPlate connecter.


HYBRIDIZATION

public static final Item HYBRIDIZATION
The item is a Hybridization.


SCAN

public static final Item SCAN
The item is a Scan.


IMAGE

public static final Item IMAGE
The item is an Image.


RAWBIOASSAY

public static final Item RAWBIOASSAY
The item is a RawBioAssay.


SPOTIMAGES

public static final Item SPOTIMAGES
The item is a SpotImages.


RAWDATA

public static final Item RAWDATA
The item is a RawData spot.


PLUGINTYPE

public static final Item PLUGINTYPE
The item is a PluginType


PLUGINDEFINITION

public static final Item PLUGINDEFINITION
The item is a PluginDefinition


PLUGINCONFIGURATION

public static final Item PLUGINCONFIGURATION
The item is a PluginConfiguration


JOB

public static final Item JOB
The item is a Job


JOBAGENT

public static final Item JOBAGENT
The item is a JobAgent


JOBAGENTSETTINGS

public static final Item JOBAGENTSETTINGS
The item is a JobAgentSettings


EXPERIMENT

public static final Item EXPERIMENT
The item is an Experiment


BIOASSAYSET

public static final Item BIOASSAYSET
The item is a BioAssaySet


BIOASSAY

public static final Item BIOASSAY
The item is a BioAssay


TRANSFORMATION

public static final Item TRANSFORMATION
The item is a Transformation


EXTRAVALUETYPE

public static final Item EXTRAVALUETYPE
The item is an ExtraValueType


EXTRAVALUE

public static final Item EXTRAVALUE
The item is an ExtraValue


FORMULA

public static final Item FORMULA
The item is a Formula


SPOTDATA

public static final Item SPOTDATA
Representing spot data, not an actual item.


VIRTUALDB

public static final Item VIRTUALDB
The item is a VirtualDb


DATACUBE

public static final Item DATACUBE
The item is a DataCube


DATACUBELAYER

public static final Item DATACUBELAYER
The item is a DataCubeLayer


DATACUBECOLUMN

public static final Item DATACUBECOLUMN
The item is a DataCubeColumn


DATACUBEFILTER

public static final Item DATACUBEFILTER
The item is a DataCubeFilter


DATACUBEEXTRAVALUE

public static final Item DATACUBEEXTRAVALUE
The item is a DataCubeExtraValue


PLATFORM

public static final Item PLATFORM
The item is a Platform


PLATFORMVARIANT

public static final Item PLATFORMVARIANT
The item is a PlatformVariant


PLATFORMFILETYPE

public static final Item PLATFORMFILETYPE
The item is a PlatformFileType


FILESET

public static final Item FILESET
The item is a FileSet


FILESETMEMBER

public static final Item FILESETMEMBER
The item is a FileSetMember


DATAFILETYPE

public static final Item DATAFILETYPE
The item is a DataFileType

Field Detail

MAX_VALUE

static int MAX_VALUE

valueMapping

private static final Map<Integer,Item> valueMapping

aliasMapping

private static final Map<String,Item> aliasMapping

itemClassMapping

private static final Map<Class<? extends BasicItem>,Item> itemClassMapping

dataClassMapping

private static final Map<Class<? extends BasicData>,Item> dataClassMapping

value

private final int value

displayValue

private final String displayValue

alias

private final String alias

itemClass

private final Class<? extends BasicItem> itemClass

dataClass

private final Class<? extends BasicData> dataClass

definedPermissions

private final Set<Permission> definedPermissions

getById

private final transient Method getById

constructor

private final transient Constructor<? extends BasicItem> constructor

deletionOrder

private final float deletionOrder

DELETION_ORDER

public static final Comparator<Identifiable> DELETION_ORDER
Method Detail

values

public static Item[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Item c : Item.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Item valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

toString

public String toString()
Overrides:
toString in class Enum<Item>

getValue

public int getValue()
Get the integer value that is used when storing an item to the database.


getAlias

public String getAlias()
Get the alias for this item, which is used in queries,

See Also:
Query.getRootAlias()

getItemClass

public Class<? extends BasicItem> getItemClass()
Get the class object that is used to handle items of this type.


getDataClass

public Class<? extends BasicData> getDataClass()
Get the data object that is used to store information in the database for items of this type.


getDefinedPermissions

public Set<Permission> getDefinedPermissions()
Get the permissions which are meaningful to assign to an item if this type. This is not used internally by the core, but is can be used by client applications to dynamically display a proper input form while assigning permissions.

Returns:
A Set containing the permissions

getDeletionOrder

public float getDeletionOrder()
Get a value indicating the deletion order. Items with a low value should be deleted before items with a high value, to minimize the risk that the BasicItem.isUsed() method returns true.

Returns:
The deletion order value
Since:
2.4

getById

public BasicItem getById(DbControl dc,
                         int id)
                  throws ItemNotFoundException,
                         PermissionDeniedException,
                         BaseException
Get the item of the type represented by this enumeration constant with the specified id. Ie. Item.SAMPLE.getById() is the same as Sample.getById.

Parameters:
dc - The DbControl object used for database access and permission checking
id - The id of the item
Returns:
An item of the type represented by this enumeration constant
Throws:
ItemNotFoundException - If an item with the specified id isn't found
PermissionDeniedException - If the logged in user hasn't read permission for the item
BaseException - If there is another error

getConstructor

Constructor<? extends BasicItem> getConstructor()
Get the default constructor for new objects of this type. The default constructor is a constructor that takes a BasicData object as the only parameter. For example Sample(SampleData data).

Returns:
The constructor, or null if no such constructor exists
See Also:
DbControl.getItem(Class, BasicData, Object[])

fromValue

public static Item fromValue(int value)
Get the Item object when you know the integer code.

Parameters:
value - Integer code
Returns:
an Item enumeration.

fromItemClass

public static Item fromItemClass(Class<? extends BasicItem> itemClass)
Get the Item object when you know the item class.

Parameters:
itemClass - Item class for which Item object should be returned
Returns:
an Item enumeration.

fromDataClass

public static Item fromDataClass(Class<? extends BasicData> dataClass)
Get the Item object when you know the data class.

Parameters:
dataClass - Data class for which the Item should be returned.
Returns:
an Item enumeration.

fromClass

public static Item fromClass(Class<?> anyClass)
Get the Item object when you know either the item or data class.

Parameters:
anyClass - The class to get corresponding Item for.
Returns:
The Item object, or null if no matching item is found

fromDataObject

public static Item fromDataObject(BasicData data)
Get the Item object when you have a data layer object. This method takes Hibernate proxies into account.

Parameters:
data - The data layer object for which corresponding Item should be returned.
Returns:
The Item object, or null if no matching item is found.

2.17.2: 2011-06-17