Package net.sf.basedb.core
Class AnnotationBatcher.CurrentAnnotationInfo
java.lang.Object
net.sf.basedb.core.AnnotationBatcher.CurrentAnnotationInfo
- All Implemented Interfaces:
LoggableData
- Enclosing class:
- AnnotationBatcher
public static class AnnotationBatcher.CurrentAnnotationInfo extends Object implements LoggableData
Holds information about an annotation for the current item.
We pre-initialize one instance for each registered annotation
type. In the setCurrentItem() method we update the instances
with information about current annotations. Before using an
entry we must always check if itemId==currentItem.id. If the
IDs don't match the entry is for a previous item and the
current item doesn't have any annotation for the annotation type.
The 'hasBeenUsed' flag is set to prevent calling the setValues() method
more than once for each annotation type.
This class exposes some information publicly since it is used for
change history logging. See
AnnotationLogger
.-
Field Summary
Fields Modifier and Type Field Description (package private) Integer
annotationId
(package private) AnnotationType
annotationType
(package private) Unit
defaultUnit
(package private) boolean
hasBeenUsed
(package private) int
itemId
(package private) Item
itemType
(package private) Date
lastUpdated
(package private) List<?>
newValues
(package private) int
overrideId
(package private) int
projectId
(package private) Integer
unitId
(package private) boolean
useProjectAnnotations
(package private) int
valueId
(package private) List<Object>
values
(package private) Type
valueType
(package private) int
version
-
Constructor Summary
Constructors Constructor Description CurrentAnnotationInfo(AnnotationType at, Item itemType)
-
Method Summary
Modifier and Type Method Description AnnotationType
getAnnotationType()
Get the annotation type.Unit
getDefaultUnit()
Get the default unit for the annotation type.int
getItemId()
Get the id of the current item.Item
getItemType()
Get the item type of the item.List<?>
getNewValues()
Get the new annotation values.List<?>
getOldValues()
Get the old annotation values.int
getProjectId()
Get the id of the project this annotation belong to.Integer
getUnitId()
Get the ID of the unit this annotation is using.Type
getValueType()
Shortcut toAnnotationType.getValueType()
.
-
Field Details
-
annotationType
-
valueType
-
defaultUnit
-
itemType
-
useProjectAnnotations
final boolean useProjectAnnotations -
itemId
int itemId -
hasBeenUsed
boolean hasBeenUsed -
annotationId
Integer annotationId -
version
int version -
unitId
Integer unitId -
valueId
int valueId -
lastUpdated
Date lastUpdated -
projectId
int projectId -
overrideId
int overrideId -
values
-
newValues
List<?> newValues
-
-
Constructor Details
-
CurrentAnnotationInfo
CurrentAnnotationInfo(AnnotationType at, Item itemType)
-
-
Method Details
-
getAnnotationType
Get the annotation type. -
getValueType
Shortcut toAnnotationType.getValueType()
. -
getDefaultUnit
Get the default unit for the annotation type.- See Also:
AnnotationType.getDefaultUnit()
-
getItemType
Get the item type of the item. -
getItemId
public int getItemId()Get the id of the current item. -
getProjectId
public int getProjectId()Get the id of the project this annotation belong to. Only relevant if the annotation type is using project-specific annotations.- Since:
- 3.19.4
-
getUnitId
Get the ID of the unit this annotation is using. -
getOldValues
Get the old annotation values. If the annotation uses units, the values are always in the default unit specified by the annotation type. -
getNewValues
Get the new annotation values. If the annotation uses units, the values are always in the default unit specified by the annotation type.
-