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
Constructors Constructor Description CustomScopeAnnotationsBuildItem(Set<org.jboss.jandex.DotName> customScopeNames)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<org.jboss.jandex.DotName>
getCustomScopeNames()
Returns a collection of all known custom scopes represented asDotName
.Optional<org.jboss.jandex.AnnotationInstance>
getScope(Collection<org.jboss.jandex.AnnotationInstance> annotations)
boolean
isCustomScopeDeclaredOn(org.jboss.jandex.ClassInfo clazz)
Returns true if the given class has some of the custom scope annotations, false otherwise.boolean
isCustomScopeIn(Collection<org.jboss.jandex.AnnotationInstance> annotations)
boolean
isScopeDeclaredOn(org.jboss.jandex.ClassInfo clazz)
Returns true if the given class has some scope annotations, false otherwise.boolean
isScopeIn(Collection<org.jboss.jandex.AnnotationInstance> annotations)
-
-
-
Constructor Detail
-
CustomScopeAnnotationsBuildItem
CustomScopeAnnotationsBuildItem(Set<org.jboss.jandex.DotName> customScopeNames)
-
-
Method Detail
-
getCustomScopeNames
public Collection<org.jboss.jandex.DotName> 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
public boolean isCustomScopeIn(Collection<org.jboss.jandex.AnnotationInstance> annotations)
- Parameters:
annotations
-- Returns:
true
if the collection contains a custom scope annotation,false
otherwise
-
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
public boolean isScopeIn(Collection<org.jboss.jandex.AnnotationInstance> annotations)
- Parameters:
annotations
-- Returns:
true
if the collection contains any scope annotation,false
otherwise- See Also:
isCustomScopeIn(Collection)
-
getScope
public Optional<org.jboss.jandex.AnnotationInstance> getScope(Collection<org.jboss.jandex.AnnotationInstance> annotations)
- Parameters:
annotations
-- Returns:
- the scope or empty optional
-
-