Package org.apache.guacamole.token
Class TokenName
- java.lang.Object
-
- org.apache.guacamole.token.TokenName
-
public class TokenName extends Object
Utility class for generating parameter token names.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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.static String
canonicalize(String name, String prefix)
Generates the name of the parameter token that should be populated with the given string.
-
-
-
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. Seecanonicalize(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.
-
-