Codota Logo
FEELParser.isVariableNameValid
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
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

  • Making http requests using okhttp
  • onCreateOptionsMenu (Activity)
  • addToBackStack (FragmentTransaction)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
  • JButton (javax.swing)
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now