|
Last update: 2011-06-23 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.proteios.core.BasicItem<D>
org.proteios.core.OwnedItem<D>
org.proteios.core.SharedItem<D>
org.proteios.core.CommonItem<AnnotationTypeData>
org.proteios.core.AnnotationType
public class AnnotationType
Objects of this class defines an annotation type. An annotation type is
always of a specific Type, ie. a string, integer, etc. Limitations
on the values can be specified, ie. min and max values, max string length,
etc. It is also possible to use a predefined list of allowed values, ie an
enumeration.
An annotation type also specifies which types of items it can be used on.
Annotatable,
Annotation| Field Summary | |
|---|---|
static int |
MAX_ADDEDPARAMETERNAME_LENGTH
The maximum length of the addedParameterName value. |
static int |
MAX_ADDEDPARAMETERTYPE_LENGTH
The maximum length of the addedParameterType value. |
static int |
MAX_ADDEDPARAMETERVALUE_LENGTH
The maximum length of the addedParameterValue value. |
static int |
MAX_DEFAULT_VALUE_LENGTH
The maximum length of the default value. |
static int |
MAX_OPTION_LENGTH
The maximum length of an option. |
static Item |
TYPE
The type of item represented by this class. |
| Fields inherited from interface org.proteios.core.Nameable |
|---|
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH |
| Method Summary | |
|---|---|
void |
disableForItem(Item itemType)
Disable this annotation type to be used for items of the specified type. |
void |
enableForItem(Item itemType)
Enable this annotation type to be used for items of the specified type. |
String |
getAddedParameterName()
Get the addedParameterName value. |
String |
getAddedParameterType()
Get the addedParameterType value. |
String |
getAddedParameterValue()
Get the addedParameterValue value. |
String |
getDefaultValue()
Get the recommended default value for new annotations of this annotation type. |
boolean |
getDisplayAsList()
Check if the enumeration values should be displayed as a selection list or as radio buttons/checkboxes by the client application. |
Set<Item> |
getEnabledItems()
Get the Item types this annotation type is enabled for. |
int |
getHeight()
Get the recommended height in characters a client application should use to render an input field for annotations of this annotation type. |
Integer |
getMaxLength()
Get the maximum allowed string length for a Type.STRING
annotation. |
Double |
getMaxValueDouble()
Get the maximum allowed value for a Type.FLOAT or
Type.DOUBLE annotation. |
Long |
getMaxValueLong()
Get the maximum allowed value for an Type.INT or
Type.LONG annotation. |
Double |
getMinValueDouble()
Get the minumum allowed value for a Type.FLOAT or
Type.DOUBLE annotation. |
Long |
getMinValueLong()
Get the minumum allowed value for an Type.INT or
Type.LONG annotation. |
int |
getMultiplicity()
Get the multiplicity. |
static ItemQuery<AnnotationType> |
getQuery(Item itemType)
Get a ItemQuery that returns annotation types. |
Item |
getType()
Get the type of item represented by the object. |
List<?> |
getValues()
Get the list of allowed values if this annotation type is an enumeration. |
Type |
getValueType()
Get the value type for this annotation type. |
int |
getWidth()
Get the recommended width in characters a client application should use to render an input field for annotations of this annotation type. |
boolean |
isAddedParameterType(String argType)
Check if the AddedParameterType is of a specific type. |
boolean |
isEnabledForItem(Item itemType)
Check if this annotation type can be used to annotate item of the specified type. |
boolean |
isEnumeration()
Check if this annotation type provides a list of predefined allowed values. |
boolean |
isRequiredForMiame()
Check an annotation of this annotation type required for an item to be compliant with the MIAME recommendation. |
boolean |
isUsed()
Checks if: Annotations of this type exists |
void |
setAddedParameterName(String addedParameterName)
Set the addedParameterName value for new annotation of this annotation type. |
void |
setAddedParameterType(String addedParameterType)
Set the addedParameterTypevalue for new annotation of this annotation type. |
void |
setAddedParameterValue(String addedParameterValue)
Set the addedParameterValue value for new annotation of this annotation type. |
void |
setDefaultValue(String defaultValue)
Set the recommended default value for new annotation of this annotation type. |
void |
setDisplayAsList(boolean displayAsList)
Set if the enumeration values should be displayed as a selection list or as radio buttons/checkboxes by the client application. |
void |
setEnumeration(boolean isEnumeration)
Set if this annotation type should provide a list of predefined allowed values. |
void |
setHeight(int height)
Set the recommended height in characters a client application should use to render an input field for annotations of this annotation type. |
void |
setMaxLength(Integer maxLength)
Set the maximum allowed string length for a Type.STRING
annotation. |
void |
setMaxValueDouble(Double maxValue)
Set the maximum allowed value for a Type.FLOAT or
Type.DOUBLE annotation. |
void |
setMaxValueLong(Long maxValue)
Set the maximum allowed value for an Type.INT or
Type.LONG annotation. |
void |
setMinValueDouble(Double minValue)
Set the minimum allowed value for a Type.FLOAT or
Type.DOUBLE annotation. |
void |
setMinValueLong(Long minValue)
Set the minimum allowed value for an Type.INT or
Type.LONG annotation. |
void |
setMultiplicity(int multiplicity)
Set the multiplicity. |
void |
setRequiredForMiame(boolean required)
Set if an annotation of this annotation type is required for an item to be compliant with the MIAME recommendation. |
void |
setValues(List<?> values)
Set the list of allowed values for an enumerated annotation type. |
void |
setValueType(Type type)
|
void |
setWidth(int width)
Set the recommended width in characters a client application should use to render an input field for annotations of this annotation type. |
void |
validateAnnotationValue(Object value)
Validate an annotation value. |
| Methods inherited from class org.proteios.core.CommonItem |
|---|
getDescription, getName, isRemoved, setDescription, setName, setRemoved |
| Methods inherited from class org.proteios.core.SharedItem |
|---|
getItemKey, getProjectKey, isShared, setItemKey, setProjectKey |
| Methods inherited from class org.proteios.core.OwnedItem |
|---|
getOwner, setOwner |
| Methods inherited from class org.proteios.core.BasicItem |
|---|
checkPermission, equals, getDbControl, getId, getPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.proteios.core.Identifiable |
|---|
getId, getVersion |
| Methods inherited from interface org.proteios.core.AccessControlled |
|---|
checkPermission, hasPermission |
| Methods inherited from interface org.proteios.core.Ownable |
|---|
getOwner, setOwner |
| Field Detail |
|---|
public static final Item TYPE
Item.ANNOTATIONTYPE,
getType()public static final int MAX_DEFAULT_VALUE_LENGTH
public static final int MAX_OPTION_LENGTH
public static final int MAX_ADDEDPARAMETERTYPE_LENGTH
public static final int MAX_ADDEDPARAMETERNAME_LENGTH
public static final int MAX_ADDEDPARAMETERVALUE_LENGTH
| Method Detail |
|---|
public static ItemQuery<AnnotationType> getQuery(Item itemType)
ItemQuery that returns annotation types. If the itemType
parameter is null, annotation types for all item types will be returned
itemType - Optional, limit the annotation types to those that are
enabled for the specified item
ItemQuery objectpublic Item getType()
IdentifiableItem enumeration.
public boolean isUsed()
throws BaseException
isUsed in class BasicItem<AnnotationTypeData>BaseExceptionpublic Type getValueType()
public int getMultiplicity()
public void setMultiplicity(int multiplicity)
throws PermissionDeniedException,
InvalidDataException
PermissionDeniedException - If the logged in user doesn't have
write permission
InvalidDataException - If the multiplicit is lower than zeropublic boolean isRequiredForMiame()
public void setRequiredForMiame(boolean required)
throws PermissionDeniedException
PermissionDeniedException - If the logged in user doesn't have
write permissionpublic boolean isEnumeration()
public void setEnumeration(boolean isEnumeration)
throws PermissionDeniedException,
InvalidDataException
PermissionDeniedException - If the logged in user doesn't have
write permission
InvalidDataException - If the value type doesn't support
enumerations, see Type.canEnumeratepublic boolean getDisplayAsList()
public void setDisplayAsList(boolean displayAsList)
throws PermissionDeniedException,
InvalidDataException
PermissionDeniedException - If the logged in user doesn't have
write permission
InvalidDataException - Neverpublic int getHeight()
public void setHeight(int height)
throws PermissionDeniedException,
InvalidDataException
height - The height in characters
PermissionDeniedException - If the logged in user doesn't have
write permission
InvalidDataException - If the height is less than onepublic int getWidth()
public void setWidth(int width)
throws PermissionDeniedException,
InvalidDataException
width - The width in characters
PermissionDeniedException - If the logged in user doesn't have
write permission
InvalidDataException - If the width is less than onepublic String getDefaultValue()
getValueType() setting.
public void setDefaultValue(String defaultValue)
throws PermissionDeniedException,
InvalidDataException
getValueType() setting.
PermissionDeniedException - If the logged in user doesn't have
write permission
InvalidDataException - If the default value is longer than
MAX_DEFAULT_VALUE_LENGTHpublic boolean isEnabledForItem(Item itemType)
itemType - The Item type
public void enableForItem(Item itemType)
throws PermissionDeniedException,
InvalidDataException
itemType - The Item type to enable this annotation type for
PermissionDeniedException - If the logged in user doesn't have
write permission
InvalidDataException - If the item type is null, or not represents
an annotatable item
public void disableForItem(Item itemType)
throws PermissionDeniedException,
InvalidDataException
itemType - The Item type to disable this annotation type for
PermissionDeniedException - If the logged in user doesn't have
write permission
InvalidDataException - If the item type is nullpublic Set<Item> getEnabledItems()
Item types this annotation type is enabled for.
Set of Item:spublic Long getMinValueLong()
Type.INT or
Type.LONG annotation.
INT or
LONG value type
public void setMinValueLong(Long minValue)
throws PermissionDeniedException,
InvalidDataException
Type.INT or
Type.LONG annotation.
minValue - The minimum allowed value or null if no limit is
specified
PermissionDeniedException - If the logged in user doesn't have
write permission
InvalidDataException - If this annotation type hasn't an
INT or LONG value typepublic Long getMaxValueLong()
Type.INT or
Type.LONG annotation.
INT or
LONG value type
public void setMaxValueLong(Long maxValue)
throws PermissionDeniedException,
InvalidDataException
Type.INT or
Type.LONG annotation.
maxValue - The maximum allowed value or null if no limit is
specified
PermissionDeniedException - If the logged in user doesn't have
write permission
InvalidDataException - If this annotation type hasn't an
INT value typepublic Double getMinValueDouble()
Type.FLOAT or
Type.DOUBLE annotation.
FLOAT or
DOUBLE value type
public void setMinValueDouble(Double minValue)
throws PermissionDeniedException,
InvalidDataException
Type.FLOAT or
Type.DOUBLE annotation.
minValue - The minimum allowed value or null if no limit is
specified
PermissionDeniedException - If the logged in user doesn't have
write permission
InvalidDataException - If this annotation type hasn't a
FLOAT or DOUBLE value typepublic Double getMaxValueDouble()
Type.FLOAT or
Type.DOUBLE annotation.
FLOAT or
DOUBLE value type
public void setMaxValueDouble(Double maxValue)
throws PermissionDeniedException,
InvalidDataException
Type.FLOAT or
Type.DOUBLE annotation.
maxValue - The maximum allowed value or null if no limit is
specified
PermissionDeniedException - If the logged in user doesn't have
write permission
InvalidDataException - If this annotation type hasn't a
FLOAT or DOUBLE value typepublic Integer getMaxLength()
Type.STRING
annotation.
STRING
value type
public void setMaxLength(Integer maxLength)
throws PermissionDeniedException,
InvalidDataException
Type.STRING
annotation.
maxLength - The maximum allowed value or null if no limit is
specified
PermissionDeniedException - If the logged in user doesn't have
write permission
InvalidDataException - If this annotation type hasn't a
STRING value type
public List<?> getValues()
throws BaseException
List with the allowed values or null if this
annotation type is not an enumeration or no values has been
specified
BaseException - If there is an errorisEnumeration()
public void setValues(List<?> values)
throws PermissionDeniedException,
InvalidDataException
values - The list of allowed values, or null to clear the values
PermissionDeniedException - If the logged in user doesn't have
write permission
InvalidDataException - If the list contains values of the wrong
type as checked by the Type.validate(List) method
public void validateAnnotationValue(Object value)
throws InvalidDataException
Float if
getValueType() returns Type.FLOAT, etc.
InvalidDataExceptionpublic String getAddedParameterType()
public void setAddedParameterType(String addedParameterType)
throws PermissionDeniedException,
InvalidDataException
PermissionDeniedException - If the logged in user doesn't have
write permission
InvalidDataException - If the addedParameterType value is longer
than MAX_ADDEDPARAMETERTYPE_LENGTHpublic String getAddedParameterName()
public void setAddedParameterName(String addedParameterName)
throws PermissionDeniedException,
InvalidDataException
addedParameterName - String the addedParameterName to set.
PermissionDeniedException - If the logged in user doesn't have
write permission
InvalidDataException - If the addedParameterName value is longer
than MAX_ADDEDPARAMETERNAME_LENGTHpublic String getAddedParameterValue()
public void setAddedParameterValue(String addedParameterValue)
throws PermissionDeniedException,
InvalidDataException
addedParameterValue - String the addedParameterValue to set.
PermissionDeniedException - If the logged in user doesn't have
write permission
InvalidDataException - If the addedParameterValue value is longer
than MAX_ADDEDPARAMETERVALUE_LENGTHpublic boolean isAddedParameterType(String argType)
argType - String the AddedParameterType to check for.
public void setValueType(Type type)
|
Last update: 2011-06-23 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||