Class InterfaceBeanNameAnnotationResolver
java.lang.Object
com.bobocode.bring.core.annotation.resolver.impl.InterfaceBeanNameAnnotationResolver
- All Implemented Interfaces:
AnnotationResolver
An implementation of AnnotationResolver designed for resolving bean names associated with interfaces.
This resolver checks if the provided class is an interface and returns its simple name as the resolved bean name.
Example usage: This resolver is tailored to handle interfaces, providing a simple resolution mechanism that utilizes the interface's simple name as the bean name.
- Since:
- 1.0
- Author:
- Blyzhnytsia Team
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isSupported
(Class<?> clazz) Checks if the resolver supports handling annotations on the specified class.Resolves the bean name for the provided interface.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
-
InterfaceBeanNameAnnotationResolver
public InterfaceBeanNameAnnotationResolver()
-
-
Method Details
-
isSupported
Checks if the resolver supports handling annotations on the specified class. Determines support based on whether the provided class is an interface.- Specified by:
isSupported
in interfaceAnnotationResolver
- Parameters:
clazz
- the class to check for being an interface- Returns:
- true if the class is an interface; false otherwise
-
resolve
Resolves the bean name for the provided interface. Returns the simple name of the interface as the bean name.- Specified by:
resolve
in interfaceAnnotationResolver
- Parameters:
clazz
- the interface class for which to resolve the bean name- Returns:
- the resolved bean name (simple interface name)
-