public class InheritSpecification extends Object implements Filter<AnnotationSnapshot>
getRemove()
is set, it override all other
settings and all inherited annotation for the specified annotation type
are removed.Modifier and Type | Field and Description |
---|---|
private AnnotationType |
annotationType |
private int |
annotationTypeId |
private boolean |
noDuplicates |
private boolean |
remove |
private boolean |
replaceExisting |
private ItemSubtype |
subtype |
Constructor and Description |
---|
InheritSpecification(AnnotationType annotationType)
Creates a new specification for the given annotation type.
|
Modifier and Type | Method and Description |
---|---|
boolean |
evaluate(AnnotationSnapshot snapshot)
Evaluate if the given object should pass the filter or not.
|
AnnotationType |
getAnnotationType() |
ItemSubtype |
getItemSubtype() |
boolean |
getNoDuplicates() |
boolean |
getRemove() |
boolean |
getReplaceExisting() |
(package private) boolean |
isAcceptableParent(Annotatable parent)
Checks if the parent item has a subtype matching the subtype (if any)
in this specification.
|
void |
setItemSubtype(ItemSubtype subtype)
Set the subtype a parent item must have if annotations should be
inherited from it.
|
void |
setNoDuplicates(boolean noDuplicates)
If this flag is set (default=true), only one annotation of the specified
annotation type can be inherited.
|
void |
setRemove(boolean remove)
Set a flag to remove all inherited annotations of the specified annotation type.
|
void |
setReplaceExisting(boolean replaceExisting)
If this flag is set (default=false), existing inherited annotations
of the specified annotation type are removed before inheriting new
ones.
|
private final int annotationTypeId
private final AnnotationType annotationType
private boolean remove
private ItemSubtype subtype
private boolean noDuplicates
private boolean replaceExisting
public InheritSpecification(AnnotationType annotationType)
public AnnotationType getAnnotationType()
public void setRemove(boolean remove)
public boolean getRemove()
public void setItemSubtype(ItemSubtype subtype)
public ItemSubtype getItemSubtype()
public void setNoDuplicates(boolean noDuplicates)
public boolean getNoDuplicates()
public void setReplaceExisting(boolean replaceExisting)
public boolean getReplaceExisting()
boolean isAcceptableParent(Annotatable parent)
BioPlate
we
check the subtype of bioplate type (BioPlateType.getItemSubtype()
)public boolean evaluate(AnnotationSnapshot snapshot)
Filter
evaluate
in interface Filter<AnnotationSnapshot>
snapshot
- The object to evaluate