Serializable, Comparable<TypeKind>public enum TypeKind extends Enum<TypeKind>
Note that it is possible additional type kinds will be added to accommodate new, currently unknown, language structures added to future versions of the Java™ programming language.
TypeMirror| 枚举常量 | 说明 |
|---|---|
ARRAY |
An array type.
|
BOOLEAN |
The primitive type
boolean. |
BYTE |
The primitive type
byte. |
CHAR |
The primitive type
char. |
DECLARED |
A class or interface type.
|
DOUBLE |
The primitive type
double. |
ERROR |
A class or interface type that could not be resolved.
|
EXECUTABLE |
A method, constructor, or initializer.
|
FLOAT |
The primitive type
float. |
INT |
The primitive type
int. |
INTERSECTION |
An intersection type.
|
LONG |
The primitive type
long. |
NONE |
A pseudo-type used where no actual type is appropriate.
|
NULL |
The null type.
|
OTHER |
An implementation-reserved type.
|
PACKAGE |
A pseudo-type corresponding to a package element.
|
SHORT |
The primitive type
short. |
TYPEVAR |
A type variable.
|
UNION |
A union type.
|
VOID |
The pseudo-type corresponding to the keyword
void. |
WILDCARD |
A wildcard type argument.
|
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
boolean |
isPrimitive() |
Returns
true if this kind corresponds to a primitive
type and false otherwise. |
static TypeKind |
valueOf(String name) |
返回带有指定名称的该类型的枚举常量。
字符串必须与用于声明该类型的枚举常量的
标识符完全匹配。(不允许有多余
的空格字符。)
|
static TypeKind[] |
values() |
按照声明该枚举类型的常量的顺序, 返回
包含这些常量的数组。该方法可用于迭代
常量, 如下所示:
for (TypeKind c : TypeKind.values()) System.out.println(c); |
public static final TypeKind BOOLEAN
boolean.public static final TypeKind BYTE
byte.public static final TypeKind SHORT
short.public static final TypeKind INT
int.public static final TypeKind LONG
long.public static final TypeKind CHAR
char.public static final TypeKind FLOAT
float.public static final TypeKind DOUBLE
double.public static final TypeKind VOID
void.NoTypepublic static final TypeKind NONE
NoTypepublic static final TypeKind NULL
public static final TypeKind ARRAY
public static final TypeKind DECLARED
public static final TypeKind ERROR
public static final TypeKind TYPEVAR
public static final TypeKind WILDCARD
public static final TypeKind PACKAGE
NoTypepublic static final TypeKind EXECUTABLE
public static final TypeKind OTHER
public static final TypeKind UNION
public static final TypeKind INTERSECTION
public static TypeKind[] values()
for (TypeKind c : TypeKind.values()) System.out.println(c);
public static TypeKind valueOf(String name)
name - 要返回的枚举常量的名称。IllegalArgumentException - 如果该枚举类型没有带有指定名称的常量NullPointerException - 如果参数为空值public boolean isPrimitive()
true if this kind corresponds to a primitive
type and false otherwise.true if this kind corresponds to a primitive type