2.17.2: 2011-06-17

net.sf.basedb.plugins
Class AnnotationFlatFileImporter.NewAnnotations

java.lang.Object
  extended by net.sf.basedb.plugins.AnnotationFlatFileImporter.NewAnnotations
Enclosing class:
AnnotationFlatFileImporter

private static class AnnotationFlatFileImporter.NewAnnotations
extends Object

Internal cache for storing annotation values from the file for a single item. The items are not annotated until the entire file has been parsed.


Field Summary
private  Annotatable item
           
private  int numAnnotations
           
private  int numError
           
private  int numRemoved
           
private  int numReplaced
           
private  int numSet
           
private  Map<AnnotationType,List<AnnotationFlatFileImporter.AnnotationValue>> values
           
 
Constructor Summary
AnnotationFlatFileImporter.NewAnnotations(Annotatable item)
          Create a new cache for the specified item.
 
Method Summary
(package private)  void addValue(AnnotationType at, Object value, Unit unit, boolean limitToMultiplicty)
          Add an annotation value.
(package private)  int getNumAnnotations()
          The total numer of annotation values that has been added to this cache.
(package private)  int getNumError()
          Number of annotations that was couldn't be set by the call to the setNewAnnotations(boolean, boolean, boolean, boolean) method because of an error (too many values).
(package private)  int getNumRemoved()
          Number of annotations that was removed by the call to the setNewAnnotations(boolean, boolean, boolean, boolean) method.
(package private)  int getNumReplaced()
          Number of annotations that was replaced by the call to the setNewAnnotations(boolean, boolean, boolean, boolean) method.
(package private)  int getNumSet()
          Number of annotations that was set (=added or replaced) by the call to the setNewAnnotations(boolean, boolean, boolean, boolean) method.
(package private)  void setNewAnnotations(boolean addToUnlimited, boolean replaceExisting, boolean failIfTooManyValues, boolean removeAnnotations)
          Annotate the item with the annotation values from the file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

item

private final Annotatable item

values

private final Map<AnnotationType,List<AnnotationFlatFileImporter.AnnotationValue>> values

numAnnotations

private int numAnnotations

numSet

private int numSet

numError

private int numError

numReplaced

private int numReplaced

numRemoved

private int numRemoved
Constructor Detail

AnnotationFlatFileImporter.NewAnnotations

AnnotationFlatFileImporter.NewAnnotations(Annotatable item)
Create a new cache for the specified item.

Method Detail

addValue

void addValue(AnnotationType at,
              Object value,
              Unit unit,
              boolean limitToMultiplicty)
Add an annotation value. The value should have been checked for error before calling this method.


getNumAnnotations

int getNumAnnotations()
The total numer of annotation values that has been added to this cache.


setNewAnnotations

void setNewAnnotations(boolean addToUnlimited,
                       boolean replaceExisting,
                       boolean failIfTooManyValues,
                       boolean removeAnnotations)
Annotate the item with the annotation values from the file.

Parameters:
addToUnlimited - TRUE to append to annotation types with multiplicity==0, FALSE to replace
replaceExisting - TRUE to replace existing annotation values, FALSE to skip
failIfTooManyValues - FALSE to skip annotations with more values than the multiplicity settings allows, TRUE to throw an exception

getNumSet

int getNumSet()
Number of annotations that was set (=added or replaced) by the call to the setNewAnnotations(boolean, boolean, boolean, boolean) method.


getNumReplaced

int getNumReplaced()
Number of annotations that was replaced by the call to the setNewAnnotations(boolean, boolean, boolean, boolean) method.


getNumRemoved

int getNumRemoved()
Number of annotations that was removed by the call to the setNewAnnotations(boolean, boolean, boolean, boolean) method.

Since:
2.8

getNumError

int getNumError()
Number of annotations that was couldn't be set by the call to the setNewAnnotations(boolean, boolean, boolean, boolean) method because of an error (too many values).


2.17.2: 2011-06-17