Package net.sf.basedb.core
Class AnnotationBatcher.CurrentAnnotationInfo
java.lang.Object
net.sf.basedb.core.AnnotationBatcher.CurrentAnnotationInfo
- All Implemented Interfaces:
LoggableData
- Enclosing class:
- AnnotationBatcher
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
Modifier and TypeFieldDescription(package private) Integer
(package private) final AnnotationType
(package private) final Unit
(package private) boolean
(package private) int
(package private) final Item
(package private) Date
(package private) List<?>
(package private) int
(package private) int
(package private) Integer
(package private) final boolean
(package private) int
(package private) final Type
(package private) int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the annotation type.Get the default unit for the annotation type.int
Get the id of the current item.Get the item type of the item.List<?>
Get the new annotation values.List<?>
Get the old annotation values.int
Get the id of the project this annotation belong to.Get the ID of the unit this annotation is using.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:
-
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.
-