Interface BeanResolver


public interface BeanResolver
Implements type-safe resolution rules.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    hasQualifier(Collection<org.jboss.jandex.AnnotationInstance> qualifiers, org.jboss.jandex.AnnotationInstance requiredQualifier)
     
    boolean
    Checks if given BeanInfo has type and qualifiers matching those in provided InjectionPointInfo.TypeAndQualifiers.
    boolean
    matches(BeanInfo bean, org.jboss.jandex.Type requiredType, Set<org.jboss.jandex.AnnotationInstance> requiredQualifiers)
    Checks if given BeanInfo has type and qualifiers matching those in provided InjectionPointInfo.TypeAndQualifiers.
    boolean
    matches(org.jboss.jandex.Type requiredType, org.jboss.jandex.Type beanType)
    Returns true if required and candidate bean type match, false otherwise.
    boolean
    matchesType(BeanInfo bean, org.jboss.jandex.Type requiredType)
    Returns true if provided bean matches required type, false otherwise
    boolean
    matchTypeArguments(org.jboss.jandex.Type requiredTypeArgument, org.jboss.jandex.Type typeArgument)
     
    Apply the ambiguous dependency resolution rules.
    resolveBeans(org.jboss.jandex.Type requiredType, Set<org.jboss.jandex.AnnotationInstance> requiredQualifiers)
    Note that this method does not attempt to resolve the ambiguity.
    default Set<BeanInfo>
    resolveBeans(org.jboss.jandex.Type requiredType, org.jboss.jandex.AnnotationInstance... requiredQualifiers)
     
  • Method Details

    • resolveBeans

      default Set<BeanInfo> resolveBeans(org.jboss.jandex.Type requiredType, org.jboss.jandex.AnnotationInstance... requiredQualifiers)
    • resolveBeans

      Set<BeanInfo> resolveBeans(org.jboss.jandex.Type requiredType, Set<org.jboss.jandex.AnnotationInstance> requiredQualifiers)
      Note that this method does not attempt to resolve the ambiguity.
      Parameters:
      requiredType -
      requiredQualifiers -
      Returns:
      the set of beans which have the given required type and qualifiers
      See Also:
    • resolveAmbiguity

      BeanInfo resolveAmbiguity(Set<BeanInfo> beans)
      Apply the ambiguous dependency resolution rules.
      Parameters:
      beans -
      Returns:
      the resolved bean, or null
      Throws:
      jakarta.enterprise.inject.AmbiguousResolutionException
    • matches

      boolean matches(BeanInfo bean, InjectionPointInfo.TypeAndQualifiers typeAndQualifiers)
      Checks if given BeanInfo has type and qualifiers matching those in provided InjectionPointInfo.TypeAndQualifiers.
      Parameters:
      bean - Candidate bean
      typeAndQualifiers - Required type and qualifiers
      Returns:
      True if provided BeanInfo matches given required type and qualifiers, false otherwise
    • matches

      boolean matches(BeanInfo bean, org.jboss.jandex.Type requiredType, Set<org.jboss.jandex.AnnotationInstance> requiredQualifiers)
      Checks if given BeanInfo has type and qualifiers matching those in provided InjectionPointInfo.TypeAndQualifiers.
      Parameters:
      bean - Candidate bean
      requiredType - Required bean type
      requiredQualifiers - Required qualifiers
      Returns:
      True if provided BeanInfo matches given required type and qualifiers, false otherwise
    • matches

      boolean matches(org.jboss.jandex.Type requiredType, org.jboss.jandex.Type beanType)
      Returns true if required and candidate bean type match, false otherwise.
      Parameters:
      requiredType - Required bean type
      beanType - Candidate bean type
      Returns:
      True if required type and bean type match, false otherwise
    • matchesType

      boolean matchesType(BeanInfo bean, org.jboss.jandex.Type requiredType)
      Returns true if provided bean matches required type, false otherwise
      Parameters:
      bean - Candidate bean
      requiredType - Required bean type
      Returns:
      Returns true if given bean matches required type, false otherwise
    • hasQualifier

      boolean hasQualifier(Collection<org.jboss.jandex.AnnotationInstance> qualifiers, org.jboss.jandex.AnnotationInstance requiredQualifier)
      Parameters:
      qualifiers -
      requiredQualifier -
      Returns:
      true if any qualifier from the collection matches the required qualifiers, false otherwise
    • matchTypeArguments

      boolean matchTypeArguments(org.jboss.jandex.Type requiredTypeArgument, org.jboss.jandex.Type typeArgument)
      Parameters:
      requiredTypeArgument -
      typeArgument -
      Returns:
      true if the required type argument matches the given type argument, false otherwise