Package net.sf.basedb.plugins
Class AnnotationFlatFileImporter.NewAnnotations
java.lang.Object
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
Fields Modifier and Type Field Description 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
Constructors Constructor Description NewAnnotations(Annotatable item)
Create a new cache for the specified item. -
Method Summary
Modifier and Type Method Description (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 thesetNewAnnotations(AnnotationBatcher, 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 thesetNewAnnotations(AnnotationBatcher, boolean, boolean, boolean, boolean)
method.(package private) int
getNumReplaced()
Number of annotations that was replaced by the call to thesetNewAnnotations(AnnotationBatcher, boolean, boolean, boolean, boolean)
method.(package private) int
getNumSet()
Number of annotations that was set (=added or replaced) by the call to thesetNewAnnotations(AnnotationBatcher, boolean, boolean, boolean, boolean)
method.(package private) void
setNewAnnotations(AnnotationBatcher batcher, boolean addToUnlimited, boolean replaceExisting, boolean failIfTooManyValues, boolean removeAnnotations)
Annotate the item with the annotation values from the file.
-
Field Details
-
item
-
values
-
numAnnotations
private int numAnnotations -
numSet
private int numSet -
numError
private int numError -
numReplaced
private int numReplaced -
numRemoved
private int numRemoved
-
-
Constructor Details
-
NewAnnotations
NewAnnotations(Annotatable item)Create a new cache for the specified item.
-
-
Method Details
-
addValue
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(AnnotationBatcher batcher, 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 replacereplaceExisting
- TRUE to replace existing annotation values, FALSE to skipfailIfTooManyValues
- 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 thesetNewAnnotations(AnnotationBatcher, boolean, boolean, boolean, boolean)
method. -
getNumReplaced
int getNumReplaced()Number of annotations that was replaced by the call to thesetNewAnnotations(AnnotationBatcher, boolean, boolean, boolean, boolean)
method. -
getNumRemoved
int getNumRemoved()Number of annotations that was removed by the call to thesetNewAnnotations(AnnotationBatcher, boolean, boolean, boolean, boolean)
method.- Since:
- 2.8
-
getNumError
int getNumError()Number of annotations that was couldn't be set by the call to thesetNewAnnotations(AnnotationBatcher, boolean, boolean, boolean, boolean)
method because of an error (too many values).
-