Class TokenName


  • public class TokenName
    extends Object
    Utility class for generating parameter token names.
    • Method Detail

      • canonicalize

        public static String canonicalize​(String name,
                                          String prefix)
        Generates the name of the parameter token that should be populated with the given string. The provided string will be automatically transformed from "CamelCase", "headlessCamelCase", "lowercase_with_underscores", and "mixes_ofBoth_Styles" to consistent "UPPERCASE_WITH_UNDERSCORES". Each returned token name will be prefixed with the string value provided in the prefix. The value provided in prefix will be prepended to the string, but will itself not be transformed.
        Parameters:
        name - The string to be used to generate the token name.
        prefix - The prefix to prepend to the generated token name.
        Returns:
        The name of the parameter token that should be populated with the given string.
      • canonicalize

        public static String canonicalize​(String name)
        Generate the name of a parameter token from the given string, with no added prefix, such that the token name will simply be the transformed version of the string. See canonicalize(java.lang.String, java.lang.String)
        Parameters:
        name - The string to use to generate the token name.
        Returns:
        The name of the parameter token that should be populated with the given string.