Class RestControllerBeanNameAnnotationResolver

java.lang.Object
com.bobocode.bring.web.servlet.scaner.resolver.RestControllerBeanNameAnnotationResolver
All Implemented Interfaces:
com.bobocode.bring.core.annotation.resolver.AnnotationResolver

public class RestControllerBeanNameAnnotationResolver extends Object implements com.bobocode.bring.core.annotation.resolver.AnnotationResolver
An implementation of AnnotationResolver specifically designed for resolving bean names associated with classes annotated with @RestController. This resolver checks for the presence of the RestController annotation on a class and returns the simple class name as the resolved bean name.

Example usage: This resolver is intended to handle classes annotated with @RestController, providing a straightforward resolution by using the class's simple name as the bean name.

Since:
1.0
Author:
Blyzhnytsia Team
  • Constructor Details

    • RestControllerBeanNameAnnotationResolver

      public RestControllerBeanNameAnnotationResolver()
  • Method Details

    • isSupported

      public boolean isSupported(Class<?> clazz)
      Checks if the resolver supports handling annotations on the specified class.
      Specified by:
      isSupported in interface com.bobocode.bring.core.annotation.resolver.AnnotationResolver
      Parameters:
      clazz - the class to check for RestController annotation
      Returns:
      true if the RestController annotation is present on the class; false otherwise
    • resolve

      public String resolve(Class<?> clazz)
      Resolves the bean name based on the @RestController annotation. Returns the simple class name as the bean name.
      Specified by:
      resolve in interface com.bobocode.bring.core.annotation.resolver.AnnotationResolver
      Parameters:
      clazz - the class for which to resolve the bean name
      Returns:
      the resolved bean name (simple class name)