Class InterceptorBindings
java.lang.Object
org.microbean.producer.InterceptorBindings
A utility class providing methods that work with interceptor bindings.
- Author:
- Laird Nelson
-
Constructor Summary
ConstructorsConstructorDescriptionInterceptorBindings(Domain domain) Creates a newInterceptorBindings.InterceptorBindings(Domain domain, AnnotationMirror metaInterceptorBinding, AnnotationMirror anyInterceptorBinding, Predicate<? super ExecutableElement> annotationElementInclusionPredicate) Creates a newInterceptorBindings. -
Method Summary
Modifier and TypeMethodDescriptionfinal AnnotationMirrorReturns a non-null, determinateAnnotationMirrorrepresenting the any interceptor binding.final booleanReturnstrueif and only if the suppliedAnnotationMirroris the same as the any interceptor binding.final List<AnnotationMirror> final booleanReturnstrueif and only if the suppliedAnnotationMirrorhas an annotation type declared by aTypeElementthat is annotated with at least one annotation deemed to be the meta-interceptor binding.interceptorBindings(Collection<? extends AnnotationMirror> as) Returns a non-null, determinate, immutableListofAnnotationMirrorinstances drawn from the suppliedCollectionthat are deemed to be interceptor bindings.Returns a non-null, determinateAnnotationMirrorrepresenting the (meta-) interceptor binding.final booleanReturnstrueif and only if the suppliedAnnotationMirrorhas an annotation type declared by aTypeElementthat is annotated with at least one annotation deemed to be the meta-interceptor binding.final List<AnnotationMirror> Returns a non-null, determinate, immutableListwhose sole element is the meta-interceptor binding annotation.
-
Constructor Details
-
InterceptorBindings
Creates a newInterceptorBindings.- Parameters:
domain- aDomain; must not benull- Throws:
NullPointerException- ifdomainisnull- See Also:
-
InterceptorBindings
public InterceptorBindings(Domain domain, AnnotationMirror metaInterceptorBinding, AnnotationMirror anyInterceptorBinding, Predicate<? super ExecutableElement> annotationElementInclusionPredicate) Creates a newInterceptorBindings.- Parameters:
domain- aDomain; must not benullmetaInterceptorBinding- anAnnotationMirrorto serve as the meta-interceptor binding; may (commonly) benullin which case a synthetic meta-interceptor binding will be used insteadanyInterceptorBinding- anAnnotationMirrorindicating that any interceptor binding should match; may benullannotationElementInclusionPredicate- aPredicatethat returnstrueif a givenExecutableElement, representing an annotation element, is to be included in any comparison operation; may benullin which case it is as if()-> truewere supplied instead- Throws:
NullPointerException- ifdomainisnull
-
-
Method Details
-
anyInterceptorBinding
Returns a non-null, determinateAnnotationMirrorrepresenting the any interceptor binding.- Returns:
- a non-
null, determinateAnnotationMirrorrepresenting the any interceptor binding
-
anyInterceptorBinding
Returnstrueif and only if the suppliedAnnotationMirroris the same as the any interceptor binding.- Parameters:
a- a non-nullAnnotationMirror- Returns:
trueif and only if the suppliedAnnotationMirroris the same as the any interceptor binding- Throws:
NullPointerException- ifaisnull- See Also:
-
anyInterceptorBindings
- Returns:
- a non-
null, determinate, immutableListhousing only the any interceptor binding
-
metaInterceptorBinding
Returns a non-null, determinateAnnotationMirrorrepresenting the (meta-) interceptor binding.- Returns:
- a non-
null, determinateAnnotationMirrorrepresenting the (meta-) interceptor binding
-
metaInterceptorBinding
Returnstrueif and only if the suppliedAnnotationMirrorhas an annotation type declared by aTypeElementthat is annotated with at least one annotation deemed to be the meta-interceptor binding.- Parameters:
a- a non-nullAnnotationMirror- Returns:
trueif and only if the suppliedAnnotationMirrorhas an annotation type declared by aTypeElementthat is annotated with at least one annotation deemed to be the meta-interceptor binding- Throws:
NullPointerException- ifaisnull
-
metaInterceptorBindings
Returns a non-null, determinate, immutableListwhose sole element is the meta-interceptor binding annotation.- Returns:
- a non-
null, determinate, immutableListwhose sole element is the meta-interceptor binding annotation
-
interceptorBinding
Returnstrueif and only if the suppliedAnnotationMirrorhas an annotation type declared by aTypeElementthat is annotated with at least one annotation deemed to be the meta-interceptor binding.- Parameters:
a- a non-nullAnnotationMirror- Returns:
trueif and only if the suppliedAnnotationMirrorhas an annotation type declared by aTypeElementthat is annotated with at least one annotation deemed to be the meta-interceptor binding- Throws:
NullPointerException- ifaisnull
-
interceptorBindings
Returns a non-null, determinate, immutableListofAnnotationMirrorinstances drawn from the suppliedCollectionthat are deemed to be interceptor bindings.In this implementation, cycles are avoided and comparisons are accomplished with the
AnnotationMirrors.sameAnnotation(AnnotationMirror, AnnotationMirror, Predicate)method.This implementation eliminates duplicates as calculated via the
AnnotationMirrors.sameAnnotation(AnnotationMirror, AnnotationMirror, Predicate)method.This implementation considers interceptor bindings to be transitive. Consequently, the returned
Listmay be greater in size than the suppliedCollection.- Parameters:
as- a non-null, determinateCollectionofAnnotationMirrors- Returns:
- a non-
null, determinate, immutableListofAnnotationMirrorinstances drawn from the suppliedCollectionthat were deemed to be interceptor bindings - Throws:
NullPointerException- ifasisnull- See Also:
-