-
public interface MetaAnnotationsAllows registering custom CDI meta-annotations: qualifiers, interceptor bindings, stereotypes, and scopes. When registering a custom scope, a context class must also be provided.- Since:
- 4.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddContext(java.lang.Class<? extends java.lang.annotation.Annotation> scopeAnnotation, boolean isNormal, java.lang.Class<? extends AlterableContext> contextClass)Registers custom context for givenscopeAnnotationand givencontextClass.voidaddContext(java.lang.Class<? extends java.lang.annotation.Annotation> scopeAnnotation, java.lang.Class<? extends AlterableContext> contextClass)Registers custom context for givenscopeAnnotationand givencontextClass.ClassConfigaddInterceptorBinding(java.lang.Class<? extends java.lang.annotation.Annotation> annotation)Registersannotationas an interceptor binding annotation.ClassConfigaddQualifier(java.lang.Class<? extends java.lang.annotation.Annotation> annotation)Registersannotationas a qualifier annotation.ClassConfigaddStereotype(java.lang.Class<? extends java.lang.annotation.Annotation> annotation)Registersannotationas a stereotype annotation.
-
-
-
Method Detail
-
addQualifier
ClassConfig addQualifier(java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
Registersannotationas a qualifier annotation. Only makes sense if the annotation is not meta-annotated@Qualifier.Returns a class configurator object that allows transforming meta-annotations on the
annotation.- Parameters:
annotation- annotation type- Returns:
- the class configurator, never
null
-
addInterceptorBinding
ClassConfig addInterceptorBinding(java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
Registersannotationas an interceptor binding annotation. Only makes sense if the annotation is not meta-annotated@InterceptorBinding.Returns a class configurator object that allows transforming meta-annotations on the
annotation.- Parameters:
annotation- annotation type- Returns:
- the class configurator, never
null
-
addStereotype
ClassConfig addStereotype(java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
Registersannotationas a stereotype annotation. Only makes sense if the annotation is not meta-annotated@Stereotype.Returns a class configurator object that allows transforming meta-annotations on the
annotation.- Parameters:
annotation- annotation type- Returns:
- the class configurator, never
null
-
addContext
void addContext(java.lang.Class<? extends java.lang.annotation.Annotation> scopeAnnotation, java.lang.Class<? extends AlterableContext> contextClass)Registers custom context for givenscopeAnnotationand givencontextClass. CDI container will create an instance of the context class once to obtain the context object. The context class must bepublicand have apubliczero-parameter constructor; it must not be a bean.Whether the scope is normal is discovered from the scope annotation. This means that the scope annotation must be meta-annotated either
@NormalScopeor@Scope.- Parameters:
scopeAnnotation- the scope annotation type, must not benullcontextClass- the context class, must not benull- Throws:
java.lang.IllegalArgumentException- if thescopeAnnotationis not meta-annotated@NormalScopeor@Scope
-
addContext
void addContext(java.lang.Class<? extends java.lang.annotation.Annotation> scopeAnnotation, boolean isNormal, java.lang.Class<? extends AlterableContext> contextClass)Registers custom context for givenscopeAnnotationand givencontextClass. CDI container will create an instance of the context class once to obtain the context object. The context class must bepublicand have apubliczero-parameter constructor; it must not be a bean.The
isNormalparameter determines whether the scope is a normal scope or a pseudo-scope.- Parameters:
scopeAnnotation- the scope annotation type, must not benullisNormal- whether the scope is normalcontextClass- the context class, must not benull
-
-