Checks if a name is a reserved keyword.
175598
private static void checkForKeyword(String name) {
    if (KEYWORDS.contains(name) || KEYWORDS.contains(name.toUpperCase())) {
      throw new MolgenisDataException(
          "Name [" + name + "] is not allowed because it is a reserved keyword.");
    }
  }
447557
boolean isAccepted(final String name) {
        for (String str : encodings) {
            if (str.equalsIgnoreCase(name)) {
                return true;
            }
        }
        return false;
    }
419894
private static boolean isPropertyName(String name) {
        return ((name.length() > 0) && Character.isUpperCase(name.charAt(0))) || ((name.length() > 1) && Character.isUpperCase(name.charAt(1)));
    }
1028712
protected final boolean isGroupNameValid(String name) {
        if (name == null) {
            return false;
        }

        if (!name.startsWith(DuracloudGroup.PREFIX)) {
            return false;
        }

        if (DuracloudGroup.PUBLIC_GROUP_NAME.equalsIgnoreCase(name)) {
            return false;
        }

        return name.substring(DuracloudGroup.PREFIX.length()).matches(
            "\\A(?![_.@\\-])[a-z0-9_.@\\-]+(?<![_.@\\-])\\Z");
    }
1220738
private boolean matchesQualifiedName(String qname, int endIndex) {
    int start = qname.lastIndexOf('.', endIndex - 1) + 1;

    switch (this.getToken()) {
      case NAME:
        String name = getString();
        return start == 0 && !name.isEmpty() && name.length() == endIndex && qname.startsWith(name);
      case THIS:
        return start == 0 && 4 == endIndex && qname.startsWith("this");
      case SUPER:
        return start == 0 && 5 == endIndex && qname.startsWith("super");
      case GETPROP:
        String prop = getLastChild().getString();
        return start > 1
            && prop.length() == endIndex - start
            && prop.regionMatches(0, qname, start, endIndex - start)
            && getFirstChild().matchesQualifiedName(qname, start - 1);

      case MEMBER_FUNCTION_DEF:
        // These are explicitly *not* qualified name components.
      default:
        return false;
    }
  }
51600
private static Name checkNotReserved(Name name, String action) {
    if (isReserved(name)) {
      throw new IllegalArgumentException("cannot " + action + ": " + name);
    }
    return name;
  }
320741
public static boolean isReservedWord(String word) {
		return !StrUtils.isEmpty(word) && RESERVED_WORDS.containsKey(word.toUpperCase());
	}
318404
@VisibleForTesting
	public boolean onlyKeyExists(String name) {
		String[] names = handleDeprecation(deprecationContext.get(), name);
		for(String n : names) {
			if ( getProps().getProperty(n,DEFAULT_STRING_CHECK)
					.equals(DEFAULT_STRING_CHECK) ) {
				return true;
			}
		}
		return false;
	}
188937
function isReserved (chr) {
        return chr === ':' || chr === '/' || chr === '?' || chr === '#' || chr === '[' || chr === ']' || chr === '@' || chr === '!' || chr === '$' || chr === '&' || chr === '(' ||
            chr === ')' || chr === '*' || chr === '+' || chr === ',' || chr === ';' || chr === '=' || chr === "'";
    }
390479
def _check_reserved_characters(self, ustring):
        
        forbidden = [c for c in gc.CONFIG_RESERVED_CHARACTERS if c in ustring]
        if len(forbidden) > 0:
            self._failed(u"The given string contains the reserved characters '%s'." % u" ".join(forbidden))
39547
function validateCommonReservedWords(name){
  // Using regular expressions to find string literals can often have a
  // negative effect on performance.
  if (name ==='break') { return false; }
  if (name === 'case') { return false; }
  if (name === 'catch') { return false; }
  if (name === 'continue') { return false; }
  if (name === 'debugger') { return false; }
  if (name === 'default') { return false; }
  if (name === 'delete') { return false; }
  if (name === 'do') { return false; }
  if (name === 'else') { return false; }
  if (name === 'finally') { return false; }
  if (name === 'for') { return false; }
  if (name === 'function') { return false; }
  if (name === 'if') { return false; }
  if (name === 'in') { return false; }
  if (name === 'instanceof') { return false; }
  if (name === 'new') { return false; }
  if (name === 'return') { return false; }
  if (name === 'switch') { return false; }
  if (name === 'this') { return false; }
  if (name === 'throw') { return false; }
  if (name === 'try') { return false; }
  if (name === 'typeof') { return false; }
  if (name === 'var') { return false; }
  if (name === 'void') { return false; }
  if (name === 'while') { return false; }
  if (name === 'with') { return false; }
  if (name === 'class') { return false; }
  if (name === 'const') { return false; }
  if (name === 'export') { return false; }
  if (name === 'extends') { return false; }
  if (name === 'import') { return false; }
  if (name === 'super') { return false; }
  if (name === 'implements') { return false; }
  if (name === 'interface') { return false; }
  if (name === 'let') { return false; }
  if (name === 'package') { return false; }
  if (name === 'private') { return false; }
  if (name === 'protected') { return false; }
  if (name === 'public') { return false; }
  if (name === 'static') { return false; }
  if (name === 'yield') { return false; }
  if (name === 'null') { return false; }
  if (name === 'true') { return false; }
  if (name === 'false') { return false; }
  if (name === 'NaN') { return false; }
  if (name === 'Infinity') { return false; }
  if (name === 'undefined') { return false; }

  return true;
}
645368
private boolean isELReserved(String id) {
        int i = 0;
        int j = reservedWords.length;
        while (i < j) {
            int k = (i + j) / 2;
            int result = reservedWords[k].compareTo(id);
            if (result == 0) {
                return true;
            }
            if (result < 0) {
                i = k + 1;
            } else {
                j = k;
            }
        }
        return false;
    }
343355
static boolean isValidPropertyName(FeatureSet mode, String name) {
    if (isValidSimpleName(name)) {
      return true;
    } else {
      return mode.has(Feature.KEYWORDS_AS_PROPERTIES) && TokenStream.isKeyword(name);
    }
  }
844685
function (name) {
        var
            idx;
        if (0 === name.length
            || -1 === _firstValidChar.indexOf(name.charAt(0))) {
            return false;
        }
        for (idx = 1; idx < name.length; ++idx) {
            if (-1 === _otherValidChars.indexOf(name.charAt(idx))) {
                return false;
            }
        }
        return true;
    }
415441
private String ensureQualified(String name) {
        String qualifier = String.format("%s.", this.modelInfo.getName());
        if (!name.startsWith(qualifier)) {
            return String.format("%s%s", qualifier, name);
        }

        return name;
    }
380566
function checkForReservedFieldName(args) {
  if (!args) {
    return;
  }
  if (args.databaseTypeName) {
    checkFieldName(args.name, args.databaseTypeName, args.shouldThrow);
  } else {
    for (let i = 0, types = Object.keys(DatabaseTypes); i < types.length; i++) {
      checkFieldName(args.name, DatabaseTypes[types[i]], args.shouldThrow);
    }
  }
}
10444
private void validateName(String name) throws DDFException {
    Boolean isNameExisted;
    try {
      this.getManager().getDDFByName(name);
      isNameExisted = true;
    } catch (DDFException e) {
      isNameExisted = false;
    }
    if(isNameExisted) {
      throw new DDFException(String.format("DDF with name %s already exists", name));
    }

    Pattern p = Pattern.compile("^[a-zA-Z0-9_-]*$");
    Matcher m = p.matcher(name);
    if(!m.find()) {
      throw new DDFException(String.format("Invalid name %s, only allow alphanumeric (uppercase and lowercase a-z, " +
          "numbers 0-9) and dash (\"-\") and underscore (\"_\")", name));
    }
  }