本文整理汇总了Java中org.eclipse.jdt.internal.corext.util.JdtFlags.isAnnotation方法的典型用法代码示例。如果您正苦于以下问题:Java JdtFlags.isAnnotation方法的具体用法?Java JdtFlags.isAnnotation怎么用?Java JdtFlags.isAnnotation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.internal.corext.util.JdtFlags
的用法示例。
在下文中一共展示了JdtFlags.isAnnotation方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isExtractSupertypeAvailable
import org.eclipse.jdt.internal.corext.util.JdtFlags; //导入方法依赖的package包/类
public static boolean isExtractSupertypeAvailable(IMember member) throws JavaModelException {
if (!member.exists()) return false;
final int type = member.getElementType();
if (type != IJavaElement.METHOD && type != IJavaElement.FIELD && type != IJavaElement.TYPE)
return false;
if (JdtFlags.isEnum(member) && type != IJavaElement.TYPE) return false;
if (!Checks.isAvailable(member)) return false;
if (member instanceof IMethod) {
final IMethod method = (IMethod) member;
if (method.isConstructor()) return false;
if (JdtFlags.isNative(method)) return false;
member = method.getDeclaringType();
} else if (member instanceof IField) {
member = member.getDeclaringType();
}
if (member instanceof IType) {
if (JdtFlags.isEnum(member) || JdtFlags.isAnnotation(member)) return false;
if (member.getDeclaringType() != null && !JdtFlags.isStatic(member)) return false;
if (((IType) member).isAnonymous())
return false; // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=253727
if (((IType) member).isLambda()) return false;
}
return true;
}
示例2: isPullUpAvailable
import org.eclipse.jdt.internal.corext.util.JdtFlags; //导入方法依赖的package包/类
public static boolean isPullUpAvailable(IMember member) throws JavaModelException {
if (!member.exists()) return false;
final int type = member.getElementType();
if (type != IJavaElement.METHOD && type != IJavaElement.FIELD && type != IJavaElement.TYPE)
return false;
if (JdtFlags.isEnum(member) && type != IJavaElement.TYPE) return false;
if (!Checks.isAvailable(member)) return false;
if (member instanceof IType) {
if (!JdtFlags.isStatic(member) && !JdtFlags.isEnum(member) && !JdtFlags.isAnnotation(member))
return false;
}
if (member instanceof IMethod) {
final IMethod method = (IMethod) member;
if (method.isConstructor()) return false;
if (JdtFlags.isNative(method)) return false;
final IType declaring = method.getDeclaringType();
if (declaring != null && declaring.isAnnotation()) return false;
}
return true;
}
示例3: isPullUpAvailable
import org.eclipse.jdt.internal.corext.util.JdtFlags; //导入方法依赖的package包/类
public static boolean isPullUpAvailable(IMember member) throws JavaModelException {
if (!member.exists())
return false;
final int type= member.getElementType();
if (type != IJavaElement.METHOD && type != IJavaElement.FIELD && type != IJavaElement.TYPE)
return false;
if (JdtFlags.isEnum(member) && type != IJavaElement.TYPE)
return false;
if (!Checks.isAvailable(member))
return false;
if (member instanceof IType) {
if (!JdtFlags.isStatic(member) && !JdtFlags.isEnum(member) && !JdtFlags.isAnnotation(member))
return false;
}
if (member instanceof IMethod) {
final IMethod method= (IMethod) member;
if (method.isConstructor())
return false;
if (JdtFlags.isNative(method))
return false;
final IType declaring= method.getDeclaringType();
if (declaring != null && declaring.isAnnotation())
return false;
}
return true;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:27,代码来源:RefactoringAvailabilityTester.java
示例4: isExtractSupertypeAvailable
import org.eclipse.jdt.internal.corext.util.JdtFlags; //导入方法依赖的package包/类
public static boolean isExtractSupertypeAvailable(IMember member) throws JavaModelException {
if (!member.exists())
return false;
final int type= member.getElementType();
if (type != IJavaElement.METHOD && type != IJavaElement.FIELD && type != IJavaElement.TYPE)
return false;
if (JdtFlags.isEnum(member) && type != IJavaElement.TYPE)
return false;
if (!Checks.isAvailable(member))
return false;
if (member instanceof IMethod) {
final IMethod method= (IMethod) member;
if (method.isConstructor())
return false;
if (JdtFlags.isNative(method))
return false;
member= method.getDeclaringType();
} else if (member instanceof IField) {
member= member.getDeclaringType();
}
if (member instanceof IType) {
if (JdtFlags.isEnum(member) || JdtFlags.isAnnotation(member))
return false;
if (member.getDeclaringType() != null && !JdtFlags.isStatic(member))
return false;
if (((IType)member).isAnonymous())
return false; // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=253727
if (((IType)member).isLambda())
return false;
}
return true;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:33,代码来源:RefactoringAvailabilityTester.java
示例5: isExtractSupertypeAvailable
import org.eclipse.jdt.internal.corext.util.JdtFlags; //导入方法依赖的package包/类
public static boolean isExtractSupertypeAvailable(IMember member) throws JavaModelException {
if (!member.exists())
return false;
final int type= member.getElementType();
if (type != IJavaElement.METHOD && type != IJavaElement.FIELD && type != IJavaElement.TYPE)
return false;
if (JdtFlags.isEnum(member) && type != IJavaElement.TYPE)
return false;
if (!Checks.isAvailable(member))
return false;
if (member instanceof IMethod) {
final IMethod method= (IMethod) member;
if (method.isConstructor())
return false;
if (JdtFlags.isNative(method))
return false;
member= method.getDeclaringType();
} else if (member instanceof IField) {
member= member.getDeclaringType();
}
if (member instanceof IType) {
if (JdtFlags.isEnum(member) || JdtFlags.isAnnotation(member))
return false;
if (member.getDeclaringType() != null && !JdtFlags.isStatic(member))
return false;
if (((IType)member).isAnonymous())
return false; // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=253727
}
return true;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:31,代码来源:RefactoringAvailabilityTester.java
示例6: getMethodOrAnnotationTypeMemberDeclarationNode
import org.eclipse.jdt.internal.corext.util.JdtFlags; //导入方法依赖的package包/类
public static BodyDeclaration getMethodOrAnnotationTypeMemberDeclarationNode(
IMethod iMethod, CompilationUnit cuNode) throws JavaModelException {
if (JdtFlags.isAnnotation(iMethod.getDeclaringType()))
return getAnnotationTypeMemberDeclarationNode(iMethod, cuNode);
else return getMethodDeclarationNode(iMethod, cuNode);
}
示例7: getMethodOrAnnotationTypeMemberDeclarationNode
import org.eclipse.jdt.internal.corext.util.JdtFlags; //导入方法依赖的package包/类
public static BodyDeclaration getMethodOrAnnotationTypeMemberDeclarationNode(IMethod iMethod, CompilationUnit cuNode) throws JavaModelException {
if (JdtFlags.isAnnotation(iMethod.getDeclaringType()))
return getAnnotationTypeMemberDeclarationNode(iMethod, cuNode);
else
return getMethodDeclarationNode(iMethod, cuNode);
}