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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
isSupported
(Class<?> clazz) Checks if the resolver supports handling annotations on the specified class.Resolves the bean name based on the @Controller annotation.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.bobocode.bring.core.annotation.resolver.AnnotationResolver
getSimpleName
-
Constructor Details
-
ControllerBeanNameAnnotationResolver
public ControllerBeanNameAnnotationResolver()
-
-
Method Details
-
isSupported
Checks if the resolver supports handling annotations on the specified class.- Specified by:
isSupported
in interfacecom.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
Resolves the bean name based on the @Controller annotation. Returns the simple class name as the bean name.- Specified by:
resolve
in interfacecom.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)
-