Package io.quarkus.arc.deployment
Class AutoAddScopeBuildItem.Builder
- java.lang.Object
-
- io.quarkus.arc.deployment.AutoAddScopeBuildItem.Builder
-
- Enclosing class:
- AutoAddScopeBuildItem
public static class AutoAddScopeBuildItem.Builder extends Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AutoAddScopeBuildItem.Builder
anyMethodMatches(Predicate<org.jboss.jandex.MethodInfo> predicate)
The class declares a method that matches the given predicate.AutoAddScopeBuildItem
build()
AutoAddScopeBuildItem.Builder
containsAnnotations(org.jboss.jandex.DotName... annotationNames)
The class or any of its element must be annotated with the given annotation.AutoAddScopeBuildItem.Builder
defaultScope(BuiltinScope scope)
The scope annotation added to the class.AutoAddScopeBuildItem.Builder
defaultScope(org.jboss.jandex.DotName scopeAnnotationName)
The scope annotation added to the class.AutoAddScopeBuildItem.Builder
implementsInterface(org.jboss.jandex.DotName interfaceName)
The class must directly or indirectly implement the given interface.AutoAddScopeBuildItem.Builder
isAnnotatedWith(org.jboss.jandex.DotName annotationName)
The class must be annotated with the given annotation.AutoAddScopeBuildItem.Builder
match(AutoAddScopeBuildItem.MatchPredicate predicate)
Set a custom predicate.AutoAddScopeBuildItem.Builder
priority(int priority)
Set the priority.AutoAddScopeBuildItem.Builder
reason(String reason)
Specify an optional reason description that is used in log messages.AutoAddScopeBuildItem.Builder
requiresContainerServices()
At least one injection point or lifecycle callback must be declared in the class hierarchy.AutoAddScopeBuildItem.Builder
scopeAlreadyAdded(BiConsumer<org.jboss.jandex.DotName,String> consumer)
If a scope was already added by anotherAutoAddScopeBuildItem
then this consumer is used to handle this situation, i.e.AutoAddScopeBuildItem.Builder
unremovable()
The bean will be unremovable.
-
-
-
Method Detail
-
requiresContainerServices
public AutoAddScopeBuildItem.Builder 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
public AutoAddScopeBuildItem.Builder unremovable()
The bean will be unremovable.- Returns:
- self
- See Also:
ArcConfig.removeUnusedBeans
-
match
public AutoAddScopeBuildItem.Builder match(AutoAddScopeBuildItem.MatchPredicate predicate)
Set a custom predicate.- Parameters:
predicate
-- Returns:
- self
-
isAnnotatedWith
public AutoAddScopeBuildItem.Builder isAnnotatedWith(org.jboss.jandex.DotName annotationName)
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
public AutoAddScopeBuildItem.Builder implementsInterface(org.jboss.jandex.DotName interfaceName)
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
public AutoAddScopeBuildItem.Builder defaultScope(org.jboss.jandex.DotName scopeAnnotationName)
The scope annotation added to the class.- Parameters:
scopeAnnotationName
-- Returns:
- self
-
defaultScope
public AutoAddScopeBuildItem.Builder defaultScope(BuiltinScope scope)
The scope annotation added to the class.- Parameters:
scope
-- Returns:
-
reason
public AutoAddScopeBuildItem.Builder reason(String reason)
Specify an optional reason description that is used in log messages.- Parameters:
reason
-- Returns:
- the reason why the scope annotation was added
-
priority
public AutoAddScopeBuildItem.Builder priority(int priority)
Set the priority. The default priority is0
. AnAutoAddScopeBuildItem
with 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 anotherAutoAddScopeBuildItem
then 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
-
build
public AutoAddScopeBuildItem build()
-
-