Class 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 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 as DotName.
        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 via getCustomScopeNames(). In order to check for presence of any scope annotation (including built-in ones), see isScopeDeclaredOn(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 via getCustomScopeNames().
        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