|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 列舉常數 | 欄位 | 方法 | 詳細資訊: 列舉常數 | 欄位 | 方法 | |||||||||
java.lang.Objectjava.lang.Enum<ElementKind>
javax.lang.model.element.ElementKind
public enum ElementKind
元素的 kind。
注意,以後可能會添加一些新的元素種類別,以適應添加到 Java™ 程式語言未來版本中的新(當前未知的)語言結構。
Element| 列舉常數摘要 | |
|---|---|
ANNOTATION_TYPE
一個註釋型別。 |
|
CLASS
沒有用更特殊的種類別(如 ENUM)描述的類別。 |
|
CONSTRUCTOR
一個建構子。 |
|
ENUM
一個列舉型別。 |
|
ENUM_CONSTANT
一個列舉常數。 |
|
EXCEPTION_PARAMETER
異常處理程序的參數。 |
|
FIELD
沒有用更特殊的種類別(如 ENUM_CONSTANT)描述的欄位。 |
|
INSTANCE_INIT
一個常數初始化程序。 |
|
INTERFACE
沒有用更特殊的種類別(如 ANNOTATION_TYPE)描述的介面。 |
|
LOCAL_VARIABLE
區域變數。 |
|
METHOD
一個方法。 |
|
OTHER
一個為實作保留的元素。 |
|
PACKAGE
一個套件。 |
|
PARAMETER
方法或建構子的參數。 |
|
STATIC_INIT
一個靜態初始化程序。 |
|
TYPE_PARAMETER
一個型別參數。 |
|
| 方法摘要 | |
|---|---|
boolean |
isClass()
如果此元素是以下種類別的類別,則返回 true:CLASS 或 ENUM。 |
boolean |
isField()
如果此元素是以下種類別的欄位,則返回 true:FIELD 或 ENUM_CONSTANT。 |
boolean |
isInterface()
如果此元素是以下種類別的介面,則返回 true:INTERFACE 或 ANNOTATION_TYPE。 |
static ElementKind |
valueOf(String name)
返回帶有指定名稱的該型別的列舉常數。 |
static ElementKind[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
| 從類別 java.lang.Enum 繼承的方法 |
|---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
| 從類別 java.lang.Object 繼承的方法 |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| 列舉常數詳細資訊 |
|---|
public static final ElementKind PACKAGE
public static final ElementKind ENUM
public static final ElementKind CLASS
ENUM)描述的類別。
public static final ElementKind ANNOTATION_TYPE
public static final ElementKind INTERFACE
ANNOTATION_TYPE)描述的介面。
public static final ElementKind ENUM_CONSTANT
public static final ElementKind FIELD
ENUM_CONSTANT)描述的欄位。
public static final ElementKind PARAMETER
public static final ElementKind LOCAL_VARIABLE
public static final ElementKind EXCEPTION_PARAMETER
public static final ElementKind METHOD
public static final ElementKind CONSTRUCTOR
public static final ElementKind STATIC_INIT
public static final ElementKind INSTANCE_INIT
public static final ElementKind TYPE_PARAMETER
public static final ElementKind OTHER
| 方法詳細資訊 |
|---|
public static final ElementKind[] values()
for(ElementKind c : ElementKind.values())
System.out.println(c);
public static ElementKind valueOf(String name)
指定要返回的列舉常數的名稱。 -
如果該列舉型別沒有帶有指定名稱的常數, - 則拋出 IllegalArgumentExceptionpublic boolean isClass()
true:CLASS 或 ENUM。
truepublic boolean isInterface()
true:INTERFACE 或 ANNOTATION_TYPE。
truepublic boolean isField()
true:FIELD 或 ENUM_CONSTANT。
true
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 列舉常數 | 欄位 | 方法 | 詳細資訊: 列舉常數 | 欄位 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。