Class NamingConfig

  • All Implemented Interfaces:

    
    public abstract class NamingConfig
    
                        

    Configuration for icon naming transformation.

    Provides both preset methods and fine-grained control over naming conventions.

    Example:

    symbolCraft {
        naming {
            pascalCase(suffix = "Icon")  // Preset
            // Or customize:
            namingConvention.set(NamingConvention.PASCAL_CASE)
            suffix.set("Icon")
            // Or use custom transformer:
            customTransformer(object : IconNameTransformer() {
                override fun transform(fileName: String): String {
                    return fileName.uppercase() + "Icon"
                }
            })
        }
    }
    • Constructor Detail

      • NamingConfig

        NamingConfig(ObjectFactory objects)
    • Method Detail

      • getSuffix

         abstract Property<String> getSuffix()

        Suffix to append to generated class names (e.g., "Icon" → HomeIcon).

      • getPrefix

         abstract Property<String> getPrefix()

        Prefix to prepend to generated class names (e.g., "Ic" → IcHome).

      • getRemovePrefix

         abstract Property<String> getRemovePrefix()

        Prefix to remove from input file names before transformation (e.g., "ic_").

      • getRemoveSuffix

         abstract Property<String> getRemoveSuffix()

        Suffix to remove from input file names before transformation (e.g., "_24dp").

      • getTransformer

         abstract Property<IconNameTransformer> getTransformer()

        Custom transformer that takes full control of naming. When set, this overrides convention-based transformation.

      • pascalCase

         final Unit pascalCase(String suffix, String prefix)

        Apply PascalCase convention with optional suffix/prefix.

        Example: home-icon → HomeIcon (with suffix = "Icon")

        Parameters:
        suffix - Optional suffix to append (e.g.
        prefix - Optional prefix to prepend (e.g.
      • camelCase

         final Unit camelCase(String suffix, String prefix)

        Apply camelCase convention with optional suffix/prefix.

        Example: home-icon → homeIcon (with prefix = "ic" → icHomeIcon)

        Parameters:
        suffix - Optional suffix to append
        prefix - Optional prefix to prepend (e.g.
      • snakeCase

         final Unit snakeCase(Boolean uppercase)

        Apply snake_case or SCREAMING_SNAKE_CASE convention.

        Example:

        • home-icon → home_icon (uppercase = false)

        • home-icon → HOME_ICON (uppercase = true)

        Parameters:
        uppercase - If true, uses SCREAMING_SNAKE_CASE
      • kebabCase

         final Unit kebabCase()

        Apply kebab-case convention.

        Example: home_icon → home-icon

      • lowerCase

         final Unit lowerCase()

        Apply lowercase convention (removes all special characters).

        Example: Home-Icon → homeicon

      • upperCase

         final Unit upperCase()

        Apply UPPERCASE convention (removes all special characters).

        Example: home-icon → HOMEICON

      • customTransformer

         final Unit customTransformer(IconNameTransformer transformer)

        Provide a custom transformer.

        This gives you full control over the naming logic and overrides convention-based transformation.

        Example:

        naming {
            customTransformer(object : IconNameTransformer() {
                override fun transform(fileName: String): String {
                    return fileName.removePrefix("ic_").capitalize() + "Icon"
                }
            })
        }
        Parameters:
        transformer - Custom IconNameTransformer instance