Tabnine Logo
FEELParser.isVariableNameValid
Code IndexAdd Tabnine to your IDE (free)

How to use
isVariableNameValid
method
in
org.kie.dmn.feel.parser.feel11.FEELParser

Best Java code snippets using org.kie.dmn.feel.parser.feel11.FEELParser.isVariableNameValid (Showing top 6 results out of 315)

origin: org.kie/kie-dmn-feel

/**
 * Either namePart is a string of digits, or it must be a valid name itself 
 */
public static boolean isVariableNamePartValid( String namePart, Scope scope ) {
  if ( DIGITS_PATTERN.matcher(namePart).matches() ) {
    return true;
  }
  if ( REUSABLE_KEYWORDS.contains(namePart) ) {
    return scope.followUp(namePart, true);
  }
  return isVariableNameValid(namePart);
}
origin: org.kie/kie-dmn-feel

@Test
public void testVariableName() {
  String var = "valid variable name";
  assertThat( FEELParser.isVariableNameValid( var ), is( true ) );
}
origin: org.kie/kie-dmn-feel

@Test
public void testVariableNameWithValidCharacters() {
  String var = "?_873./-'+*valid";
  assertThat( FEELParser.isVariableNameValid( var ), is( true ) );
}
origin: org.kie/kie-dmn-feel

@Test
public void testVariableNameWithInvalidCharacterPercent() {
  String var = "?_873./-'%+*valid";
  assertThat( FEELParser.isVariableNameValid( var ), is( false ) );
  assertThat( FEELParser.checkVariableName( var ).get( 0 ).getMessage(), is( Msg.createMessage(Msg.INVALID_VARIABLE_NAME, "character", "%") ) );
}
origin: org.kie/kie-dmn-feel

@Test
public void testVariableNameInvalidStartCharacter() {
  String var = "5variable can't start with a number";
  assertThat( FEELParser.isVariableNameValid( var ), is( false ) );
  assertThat( FEELParser.checkVariableName( var ).get( 0 ).getMessage(), is( Msg.createMessage(Msg.INVALID_VARIABLE_NAME_START, "character", "5") ) );
}
origin: org.kie/kie-dmn-feel

@Test
public void testVariableNameCantStartWithKeyword() {
  String var = "for keyword is an invalid start for a variable name";
  assertThat( FEELParser.isVariableNameValid( var ), is( false ) );
  assertThat( FEELParser.checkVariableName( var ).get( 0 ).getMessage(), is( Msg.createMessage(Msg.INVALID_VARIABLE_NAME_START, "keyword", "for") ) );
}
org.kie.dmn.feel.parser.feel11FEELParserisVariableNameValid

Popular methods of FEELParser

  • checkVariableName
  • parse
  • defineVariables
  • isVariableNamePartValid
    Either namePart is a string of digits, or it must be a valid name itself

Popular in Java

  • Start an intent from android
  • setRequestProperty (URLConnection)
  • setContentView (Activity)
  • startActivity (Activity)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • JComboBox (javax.swing)
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now