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 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 @RestController 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
-
RestControllerBeanNameAnnotationResolver
public RestControllerBeanNameAnnotationResolver()
-
-
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 RestController annotation- Returns:
- true if the RestController annotation is present on the class; false otherwise
-
resolve
Resolves the bean name based on the @RestController 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)
-