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. SeeAnnotationLogger
.
-
-
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
All Methods Instance Methods Concrete Methods 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.Integer
getUnitId()
Get the ID of the unit this annotation is using.Type
getValueType()
Shortcut toAnnotationType.getValueType()
.
-
-
-
Field Detail
-
annotationType
final AnnotationType annotationType
-
valueType
final Type valueType
-
defaultUnit
final Unit defaultUnit
-
itemType
final Item 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
-
newValues
List<?> newValues
-
-
Constructor Detail
-
CurrentAnnotationInfo
CurrentAnnotationInfo(AnnotationType at, Item itemType)
-
-
Method Detail
-
getAnnotationType
public AnnotationType getAnnotationType()
Get the annotation type.
-
getValueType
public Type getValueType()
Shortcut toAnnotationType.getValueType()
.
-
getDefaultUnit
public Unit getDefaultUnit()
Get the default unit for the annotation type.- See Also:
AnnotationType.getDefaultUnit()
-
getItemType
public Item getItemType()
Get the item type of the item.
-
getItemId
public int getItemId()
Get the id of the current item.
-
getUnitId
public Integer getUnitId()
Get the ID of the unit this annotation is using.
-
getOldValues
public List<?> 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
public List<?> getNewValues()
Get the new annotation values. If the annotation uses units, the values are always in the default unit specified by the annotation type.
-
-