Enum NameCategory
- All Implemented Interfaces:
Serializable
,Comparable<NameCategory>
,java.lang.constant.Constable
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)
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionboolean
isNameAcceptable(String name)
Is the given name acceptable for the given category?boolean
Certain category include two or more unambiguous categories.boolean
isValid()
static NameCategory
Returns the enum constant of this type with the specified name.static NameCategory[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
MODULE_NAME
-
PACKAGE_NAME
-
TYPE_NAME
-
EXPRESSION_NAME
-
METHOD_NAME
-
PACKAGE_OR_TYPE_NAME
-
AMBIGUOUS_NAME
-
COMPILATION_ERROR
-
-
Method Details
-
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
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 nameNullPointerException
- 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
Is the given name acceptable for the given category? -
isValid
public boolean isValid()
-