本文整理匯總了Java中org.eclipse.jdt.core.dom.Modifier.ABSTRACT屬性的典型用法代碼示例。如果您正苦於以下問題:Java Modifier.ABSTRACT屬性的具體用法?Java Modifier.ABSTRACT怎麽用?Java Modifier.ABSTRACT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.eclipse.jdt.core.dom.Modifier
的用法示例。
在下文中一共展示了Modifier.ABSTRACT屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: decideRuleKind
private static String decideRuleKind(ReferencedClassesParser parser, Set<String> dependencies) {
CompilationUnit cu = parser.compilationUnit;
if (cu.types().isEmpty()) {
return "java_library";
}
AbstractTypeDeclaration topLevelClass = (AbstractTypeDeclaration) cu.types().get(0);
if ((topLevelClass.getModifiers() & Modifier.ABSTRACT) != 0) {
// Class is abstract, can't be a test.
return "java_library";
}
// JUnit 4 tests
if (parser.className.endsWith("Test") && dependencies.contains("org.junit.Test")) {
return "java_test";
}
if (any(
topLevelClass.bodyDeclarations(),
d -> d instanceof MethodDeclaration && isMainMethod((MethodDeclaration) d))) {
return "java_binary";
}
return "java_library";
}
示例2: consumes
@Override
public boolean consumes(SemanticToken token) {
SimpleName node = token.getNode();
if (node.isDeclaration()) return false;
IBinding binding = token.getBinding();
boolean isAbstractMethod =
binding != null
&& binding.getKind() == IBinding.METHOD
&& (binding.getModifiers() & Modifier.ABSTRACT) == Modifier.ABSTRACT;
if (!isAbstractMethod) return false;
// filter out annotation value references
if (binding != null) {
ITypeBinding declaringType = ((IMethodBinding) binding).getDeclaringClass();
if (declaringType.isAnnotation()) return false;
}
return true;
}
示例3: evaluateModifiers
private int evaluateModifiers() {
if (getSenderBinding().isInterface()) {
return 0;
} else {
int modifiers = fMethod.getModifiers();
if (Modifier.isPrivate(modifiers)) {
modifiers |= Modifier.PROTECTED;
}
return modifiers
& (Modifier.PUBLIC | Modifier.PROTECTED | Modifier.ABSTRACT | Modifier.STRICTFP);
}
}
示例4: isAbstract
public static boolean isAbstract(ITypeBinding type) {
return (type.getModifiers() & Modifier.ABSTRACT) != 0;
}