Interface ConfigurationBeanAliasGenerator
-
- All Known Implementing Classes:
DefaultConfigurationBeanAliasGenerator,HyphenAliasGenerator,JoinAliasGenerator,UnderScoreJoinAliasGenerator
public interface ConfigurationBeanAliasGeneratorA strategy interface for generating aliases for configuration beans.Implementations of this interface should provide a consistent and unique alias generation mechanism based on the provided prefix, bean name, and configuration class.
- Since:
- 1.0.0
- Author:
- qi.li, Mercy
- See Also:
DefaultConfigurationBeanAliasGenerator,HyphenAliasGenerator,UnderScoreJoinAliasGenerator
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgenerateAlias(java.lang.String prefix, java.lang.String beanName, java.lang.Class<?> configClass)Generates an alias for a configuration bean based on the provided prefix, bean name, and configuration class.
-
-
-
Method Detail
-
generateAlias
java.lang.String generateAlias(java.lang.String prefix, java.lang.String beanName, java.lang.Class<?> configClass)Generates an alias for a configuration bean based on the provided prefix, bean name, and configuration class.This method should create a unique and consistent alias by combining the given prefix, bean name, and the simple name of the configuration class. Implementations are expected to handle cases where any of the inputs may be
nullor empty, ensuring a valid alias is returned.Example: Given a prefix of "app", a bean name of "dataSource", and a configuration class named
DatabaseConfig, this method might return:"appDataSourceDatabaseConfig".- Parameters:
prefix- the prefix to be used in the alias; may benullor emptybeanName- the name of the bean for which the alias is being generated; must not benullor emptyconfigClass- the configuration class associated with the bean; may benullif no specific configuration class is associated- Returns:
- a generated alias as a
String; nevernull
-
-