Package io.quarkus.arc.deployment
Class AutoAddScopeBuildItem.Builder
java.lang.Object
io.quarkus.arc.deployment.AutoAddScopeBuildItem.Builder
- Enclosing class:
- AutoAddScopeBuildItem
-
Method Summary
Modifier and TypeMethodDescriptionThe final predicate is a short-circuiting logical AND of the previous predicate (if any) and this condition.anyMethodMatches(Predicate<org.jboss.jandex.MethodInfo> predicate) The class declares a method that matches the given predicate.build()containsAnnotations(org.jboss.jandex.DotName... annotationNames) The class or any of its element must be annotated with the given annotation.defaultScope(BuiltinScope scope) The scope annotation added to the class.defaultScope(org.jboss.jandex.DotName scopeAnnotationName) The scope annotation added to the class.implementsInterface(org.jboss.jandex.DotName interfaceName) The class must directly or indirectly implement the given interface.isAnnotatedWith(org.jboss.jandex.DotName annotationName) The class must be annotated with the given annotation.match(AutoAddScopeBuildItem.MatchPredicate predicate) Set a custom predicate.priority(int priority) Set the priority.Specify an optional reason description that is used in log messages.At least one injection point or lifecycle callback must be declared in the class hierarchy.scopeAlreadyAdded(BiConsumer<org.jboss.jandex.DotName, String> consumer) If a scope was already added by anotherAutoAddScopeBuildItemthen this consumer is used to handle this situation, i.e.The bean will be unremovable.
-
Method Details
-
requiresContainerServices
At least one injection point or lifecycle callback must be declared in the class hierarchy. Otherwise, the scope annotation is not added.Note that the detection algorithm is just the best effort. Some inheritance rules defined by the spec are not followed, e.g. per spec an initializer method is only inherited if not overridden. This method merely scans the annotations.
- Returns:
- self
-
unremovable
The bean will be unremovable.- Returns:
- self
- See Also:
-
match
Set a custom predicate.The previous predicate (if any) is replaced.
- Parameters:
predicate-- Returns:
- self
-
isAnnotatedWith
The class must be annotated with the given annotation. Otherwise, the scope annotation is not added.The final predicate is a short-circuiting logical AND of the previous predicate (if any) and this condition.
- Parameters:
annotationName-- Returns:
- self
-
containsAnnotations
public AutoAddScopeBuildItem.Builder containsAnnotations(org.jboss.jandex.DotName... annotationNames) The class or any of its element must be annotated with the given annotation. Otherwise, the scope annotation is not added.The final predicate is a short-circuiting logical AND of the previous predicate (if any) and this condition.
- Parameters:
annotationNames-- Returns:
- self
-
anyMethodMatches
public AutoAddScopeBuildItem.Builder anyMethodMatches(Predicate<org.jboss.jandex.MethodInfo> predicate) The class declares a method that matches the given predicate.The final predicate is a short-circuiting logical AND of the previous predicate (if any) and this condition.
- Parameters:
predicate-- Returns:
- self
-
implementsInterface
The class must directly or indirectly implement the given interface.The final predicate is a short-circuiting logical AND of the previous predicate (if any) and this condition.
- Parameters:
interfaceName-- Returns:
- self
-
defaultScope
The scope annotation added to the class.- Parameters:
scopeAnnotationName-- Returns:
- self
-
defaultScope
The scope annotation added to the class.- Parameters:
scope-- Returns:
-
reason
Specify an optional reason description that is used in log messages.- Parameters:
reason-- Returns:
- the reason why the scope annotation was added
-
priority
Set the priority. The default priority is0. AnAutoAddScopeBuildItemwith higher priority takes precedence.- Parameters:
priority-- Returns:
- self
-
scopeAlreadyAdded
public AutoAddScopeBuildItem.Builder scopeAlreadyAdded(BiConsumer<org.jboss.jandex.DotName, String> consumer) If a scope was already added by anotherAutoAddScopeBuildItemthen this consumer is used to handle this situation, i.e. log a warning or throw an exception. The first argument is theAutoAddScopeBuildItem.getDefaultScope()and the second argument is theAutoAddScopeBuildItem.getReason().- Parameters:
consumer-- Returns:
- self
-
and
The final predicate is a short-circuiting logical AND of the previous predicate (if any) and this condition.- Parameters:
other-- Returns:
- self
-
build
-