本文整理汇总了Java中org.eclipse.jdt.core.IField.isEnumConstant方法的典型用法代码示例。如果您正苦于以下问题:Java IField.isEnumConstant方法的具体用法?Java IField.isEnumConstant怎么用?Java IField.isEnumConstant使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.core.IField
的用法示例。
在下文中一共展示了IField.isEnumConstant方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFields
import org.eclipse.jdt.core.IField; //导入方法依赖的package包/类
/**
* Creates {@link Field} objects for all instance fields of the type
*
* @param type the type declaring the field that will be moved to the extracted class
* @return an instance of {@link Field} for every field declared in type that is not static
* @throws JavaModelException if the type does not exist or if an exception occurs while accessing
* its corresponding resource.
*/
public static Field[] getFields(IType type) throws JavaModelException {
IField[] fields = type.getFields();
ArrayList result = new ArrayList();
for (int i = 0; i < fields.length; i++) {
IField field = fields[i];
if (!Flags.isStatic(field.getFlags()) && !field.isEnumConstant())
result.add(new Field(field.getElementName()));
}
return (Field[]) result.toArray(new Field[result.size()]);
}