Class InterfaceBeanNameAnnotationResolver

java.lang.Object
com.bobocode.bring.core.annotation.resolver.impl.InterfaceBeanNameAnnotationResolver
All Implemented Interfaces:
AnnotationResolver

public class InterfaceBeanNameAnnotationResolver extends Object implements 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 Details

    • InterfaceBeanNameAnnotationResolver

      public InterfaceBeanNameAnnotationResolver()
  • Method Details

    • isSupported

      public boolean isSupported(Class<?> clazz)
      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 interface AnnotationResolver
      Parameters:
      clazz - the class to check for being an interface
      Returns:
      true if the class is an interface; false otherwise
    • resolve

      public String resolve(Class<?> clazz)
      Resolves the bean name for the provided interface. Returns the simple name of the interface as the bean name.
      Specified by:
      resolve in interface AnnotationResolver
      Parameters:
      clazz - the interface class for which to resolve the bean name
      Returns:
      the resolved bean name (simple interface name)