isAutowireCandidate method

  1. @override
bool isAutowireCandidate(
  1. String podName,
  2. DependencyDescriptor descriptor
)

Checks if a pod is a candidate for autowiring for the given dependency.

This method considers various factors including dependency type, qualifiers, and other autowiring conditions.

Usage Example:

final candidate = factory.isAutowireCandidate('userService', descriptor);
if (candidate) {
  print('userService is a valid autowire candidate for this dependency');
}

@param podName The name of the pod to check @param descriptor The dependency descriptor @return true if the pod is a valid autowire candidate

Implementation

@override
bool isAutowireCandidate(String podName, DependencyDescriptor descriptor) {
  final f = getPodFactory();

  if (f.isAutowireCandidate(podName, descriptor)) {
    return true;
  }

  if (_parent != null) {
    return _parent!.getPodFactory().isAutowireCandidate(podName, descriptor);
  }

  return false;
}