Class HyphenAliasGenerator

java.lang.Object
io.microsphere.spring.beans.factory.support.JoinAliasGenerator
io.microsphere.spring.beans.factory.support.HyphenAliasGenerator
All Implemented Interfaces:
ConfigurationBeanAliasGenerator

public class HyphenAliasGenerator extends JoinAliasGenerator
HyphenAliasGenerator is an implementation of JoinAliasGenerator that uses a hyphen ("-") as the separator between bean name parts.

This class is typically used in Spring's bean alias generation process to create aliases by joining parts of bean names with a hyphen. For example, a bean named "userService" might be aliased as "user-service" if it's split into parts and joined using this generator.

Example Usage


 // Given a bean name "myCustomService"
 String[] parts = {"my", "custom", "service"};
 String alias = new HyphenAliasGenerator().generate(parts);
 System.out.println(alias); // Output: "my-custom-service"
 
Since:
1.0.0
Author:
qi.li, Mercy
  • Constructor Details

    • HyphenAliasGenerator

      public HyphenAliasGenerator()
  • Method Details