Package net.sf.basedb.core.snapshot
Class DisabledInheritanceFilter
java.lang.Object
net.sf.basedb.core.snapshot.DisabledInheritanceFilter
- All Implemented Interfaces:
Filter<AnnotationSnapshot>
Filter implementation that filters away annotations that
have an annotation type with inheritance disabled. A parent
filter may be specified with
setParentFilter(Filter)
which is checked before checking the annotation type. This
filter will only accept an annotatin if the parent filter accepts
it and if the annotation type allows inheritance.- Since:
- 3.5
- Author:
- Nicklas
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreate a new filter.Create a clone of another filter instance. -
Method Summary
Modifier and TypeMethodDescriptionboolean
evaluate
(AnnotationSnapshot snapshot) Evaluate if the given object should pass the filter or not.void
setParentFilter
(Filter<? super AnnotationSnapshot> parent) Set a parent filter that must also be passed in order for the this filter to pass an annotation.
-
Field Details
-
disabled
-
parent
-
-
Constructor Details
-
DisabledInheritanceFilter
Create a new filter. It will load all current annotation types with disabled inheritance and store internally. -
DisabledInheritanceFilter
Create a clone of another filter instance. Use this method to re-use the loaded annotation types when there is a risk of thread issues by using the root filter together with thesetParentFilter(Filter)
method.
-
-
Method Details
-
evaluate
Description copied from interface:Filter
Evaluate if the given object should pass the filter or not.- Specified by:
evaluate
in interfaceFilter<AnnotationSnapshot>
- Parameters:
snapshot
- The object to evaluate- Returns:
- TRUE if the object passes the filter, FALSE otherwise
-
setParentFilter
Set a parent filter that must also be passed in order for the this filter to pass an annotation.
-