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 Details

    • 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
    • values

      final List<Object> values
    • newValues

      List<?> newValues
  • Constructor Details

  • Method Details

    • getAnnotationType

      public AnnotationType getAnnotationType()
      Get the annotation type.
    • getValueType

      public Type 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.
    • 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

      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.