Class ControllerBeanNameAnnotationResolver

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

public class ControllerBeanNameAnnotationResolver extends Object implements com.bobocode.bring.core.annotation.resolver.AnnotationResolver
An implementation of AnnotationResolver used for resolving bean names associated with classes annotated with @Controller. This resolver checks for the presence of the Controller 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 @Controller, providing a straightforward resolution by using the class's simple name as the bean name.

Since:
1.0
Author:
Blyzhnytsia Team
  • Constructor Details

    • ControllerBeanNameAnnotationResolver

      public ControllerBeanNameAnnotationResolver()
  • 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 Controller annotation
      Returns:
      true if the Controller annotation is present on the class; false otherwise
    • resolve

      public String resolve(Class<?> clazz)
      Resolves the bean name based on the @Controller 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)