Validates that the Lexical token name matches the current spec. currently non null, non empty, @param name - the name to be validated. @return the name if valid, or AssertException if invalid.
(@Nullable String name)
| 232 | * @return the name if valid, or AssertException if invalid. |
| 233 | */ |
| 234 | public static String assertValidName(@Nullable String name) { |
| 235 | if (name != null && isValidName(name)) { |
| 236 | return name; |
| 237 | } |
| 238 | return throwAssert(invalidNameErrorMessage, String.valueOf(name)); |
| 239 | } |
| 240 | |
| 241 | /** |
| 242 | * Fast character-by-character validation without regex. |
no test coverage detected