java.lang.Object
java.lang.Enum<NameCategory>
com.github.javaparser.symbolsolver.resolution.naming.NameCategory
All Implemented Interfaces:
Serializable, Comparable<NameCategory>, java.lang.constant.Constable

public enum NameCategory extends Enum<NameCategory>
Context causes a name syntactically to fall into one of seven categories: ModuleName, PackageName, TypeName, ExpressionName, MethodName, PackageOrTypeName, or AmbiguousName. TypeName is less expressive than the other six categories, because it is denoted with TypeIdentifier, which excludes the character sequence var (ยง3.8). See JLS 6.5 (https://docs.oracle.com/javase/specs/jls/se10/html/jls-6.html#jls-6.5)
  • Enum Constant Details

    • MODULE_NAME

      public static final NameCategory MODULE_NAME
    • PACKAGE_NAME

      public static final NameCategory PACKAGE_NAME
    • TYPE_NAME

      public static final NameCategory TYPE_NAME
    • EXPRESSION_NAME

      public static final NameCategory EXPRESSION_NAME
    • METHOD_NAME

      public static final NameCategory METHOD_NAME
    • PACKAGE_OR_TYPE_NAME

      public static final NameCategory PACKAGE_OR_TYPE_NAME
    • AMBIGUOUS_NAME

      public static final NameCategory AMBIGUOUS_NAME
    • COMPILATION_ERROR

      public static final NameCategory COMPILATION_ERROR
  • Method Details

    • values

      public static NameCategory[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static NameCategory valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • isNeedingDisambiguation

      public boolean isNeedingDisambiguation()
      Certain category include two or more unambiguous categories. These ambiguous categories are recognized solely through a syntactic process. In order to disambiguate them a semantic process (i.e., consider the symbols which are actually visible in a given context) is needed.
    • isNameAcceptable

      public boolean isNameAcceptable(String name)
      Is the given name acceptable for the given category?
    • isValid

      public boolean isValid()