Class NameValidator

java.lang.Object
com.aquima.interactions.metamodel.impl.NameValidator

public final class NameValidator extends Object
This utility class validates if a name is valid to be used as identifier for an attribute, entity or instance.
Since:
6.3
Author:
O. Kerpershoek
  • Method Details

    • validateName

      public static NameValidator.IResult validateName(String name)
      This method validates the name passed to the method, and returns an error code when the name is not valid. The error code expected 2 parameters: The name and the type of object the name was validated for.
      Parameters:
      name - The name that should be validated.
      Returns:
      ErrorCode indicating why the name is not valid, or null when the name is valid.
    • isValidIdentifier

      public static boolean isValidIdentifier(String name)
      This method validates if a name is a valid identifier. An identifier should start with a letter, optionally followed by letters, digits, underscores or (since 8.1) at sign.
      Parameters:
      name - The name that should be checked.
      Returns:
      Boolean indicating if the name is a valid identifier.
    • isKeyword

      public static boolean isKeyword(String name)
      This method checks if the name is a keyword.
      Parameters:
      name - The name that should be checked.
      Returns:
      Boolean indicating if the name represents a keyword.