# findAnnotationOnPod<A> method

1. @override

Future<A?> findAnnotationOnPod<A>(

1. String podName,
2. Class<A> type

)
override

Finds a specific annotation on a pod.

This method looks for annotations of the specified type on the given pod and returns the first one found.

## Usage Example:

    final annotation = await factory.findAnnotationOnPod<RestController>(
      'userController',
      Class<RestController>(),
    );

    if (annotation != null) {
      print('Controller path: ${annotation.path}');
    }

@param podName The name of the pod to check @param type The annotation type to look for @return A Future that completes with the annotation or null if not found

## Implementation

    @override
    Future<A?> findAnnotationOnPod<A>(String podName, Class<A> type) async {
      try {
        if (containsDefinition(podName)) {
          final podDef = getDefinition(podName);
          final podClass = podDef.type;

          if (podClass.hasDirectAnnotation<A>()) {
            return podClass.getDirectAnnotation<A>();
          } else if (podDef.hasAnnotation<A>()) {
            return podDef.getAnnotation<A>();
          }
        }
      } catch (e) {
        if(_logger.getIsTraceEnabled()) {
          _logger.trace("Could not find annotation on pod '$podName': $e");
        }
      }

      return null;
    }