Package io.quarkus.arc.deployment
Class CustomScopeAnnotationsBuildItem
java.lang.Object
io.quarkus.builder.item.BuildItem
io.quarkus.builder.item.SimpleBuildItem
io.quarkus.arc.deployment.CustomScopeAnnotationsBuildItem
public final class CustomScopeAnnotationsBuildItem
extends io.quarkus.builder.item.SimpleBuildItem
Holds information about all known custom scopes in the deployment and has utility methods allowing to check
whether given class has some scope annotation.
-
Constructor Summary
ConstructorsConstructorDescriptionCustomScopeAnnotationsBuildItem(Set<org.jboss.jandex.DotName> customScopeNames) -
Method Summary
Modifier and TypeMethodDescriptionCollection<org.jboss.jandex.DotName>Returns a collection of all known custom scopes represented asDotName.Optional<org.jboss.jandex.AnnotationInstance>getScope(Collection<org.jboss.jandex.AnnotationInstance> annotations) booleanisCustomScopeDeclaredOn(org.jboss.jandex.ClassInfo clazz) Returns true if the given class has some of the custom scope annotations, false otherwise.booleanisCustomScopeIn(Collection<org.jboss.jandex.AnnotationInstance> annotations) booleanisScopeDeclaredOn(org.jboss.jandex.ClassInfo clazz) Returns true if the given class has some scope annotations, false otherwise.booleanisScopeIn(Collection<org.jboss.jandex.AnnotationInstance> annotations)
-
Constructor Details
-
CustomScopeAnnotationsBuildItem
CustomScopeAnnotationsBuildItem(Set<org.jboss.jandex.DotName> customScopeNames)
-
-
Method Details
-
getCustomScopeNames
Returns a collection of all known custom scopes represented asDotName.- Returns:
- collection of known custom scopes (built-in scopes are not included)
-
isCustomScopeDeclaredOn
public boolean isCustomScopeDeclaredOn(org.jboss.jandex.ClassInfo clazz) Returns true if the given class has some of the custom scope annotations, false otherwise. List of known custom scopes can be seen viagetCustomScopeNames(). In order to check for presence of any scope annotation (including built-in ones), seeisScopeDeclaredOn(ClassInfo).- Parameters:
clazz- Class to check for annotations- Returns:
- true if the clazz contains some of the custom scope annotations, false otherwise
-
isCustomScopeIn
- Parameters:
annotations-- Returns:
trueif the collection contains a custom scope annotation,falseotherwise
-
isScopeDeclaredOn
public boolean isScopeDeclaredOn(org.jboss.jandex.ClassInfo clazz) Returns true if the given class has some scope annotations, false otherwise. This method check for all scope annotations, including built-in ones as well as custom scopes. List of known custom scopes can be seen viagetCustomScopeNames().- Parameters:
clazz- Class to check for annotations- Returns:
- true if the clazz contains any scope annotation, false otherwise
-
isScopeIn
- Parameters:
annotations-- Returns:
trueif the collection contains any scope annotation,falseotherwise- See Also:
-
getScope
public Optional<org.jboss.jandex.AnnotationInstance> getScope(Collection<org.jboss.jandex.AnnotationInstance> annotations) - Parameters:
annotations-- Returns:
- the scope or empty optional
-