@Test public void testValidationWhenVariableNameContainsInvalidCharacters() { assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable ! name")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable @ name")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable # name")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable $ name")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable $ name")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable % name")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable & name")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable ^ name")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable ( name")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable ) name")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable \" name")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable ° name")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable § name")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable ← name")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable → name")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable ↓ name")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable ¢ name")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable µ name")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable { name")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable } name")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable [ name")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable ] name")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable | name")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable \\ name")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable = name")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable < name")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable > name")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable ; name")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable : name")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable , name")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable ¶ name")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable « name")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable » name")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable ” name")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("variable “ name")).isFalse(); }
public static boolean isVariableNameValid(final String variableName) { return notEmpty(variableName) && firstCharacterIsValid(variableName) && firstWordIsNotReservedKeyword(variableName) && doesNotContainForbiddenChars(variableName); }
FEELSyntaxLightValidator { public static boolean isVariableNameValid(final String variableName) { return notEmpty(variableName) && firstCharacterIsValid(variableName) && firstWordIsNotReservedKeyword(variableName) && doesNotContainForbiddenChars(variableName); } }
FEELSyntaxLightValidator { public static boolean isVariableNameValid(final String variableName) { return notEmpty(variableName) && firstCharacterIsValid(variableName) && firstWordIsNotReservedKeyword(variableName) && doesNotContainForbiddenChars(variableName); }  }
FEELSyntaxLightValidator { public static boolean isVariableNameValid(final String variableName) { return notEmpty(variableName) && firstCharacterIsValid(variableName) && firstWordIsNotReservedKeyword(variableName) && doesNotContainForbiddenChars(variableName); }  static boolean isVariableNameValid(final String variableName); }
FEELSyntaxLightValidator { public static boolean isVariableNameValid(final String variableName) { return notEmpty(variableName) && firstCharacterIsValid(variableName) && firstWordIsNotReservedKeyword(variableName) && doesNotContainForbiddenChars(variableName); }  static boolean isVariableNameValid(final String variableName);  }