Java Code Examples for org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration#isDefaultConstructor()
The following examples show how to use
org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration#isDefaultConstructor() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SourceIndexerRequestor.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 6 votes |
private void addDefaultConstructorIfNecessary(TypeInfo typeInfo) { boolean hasConstructor = false; TypeDeclaration typeDeclaration = typeInfo.node; AbstractMethodDeclaration[] methods = typeDeclaration.methods; int methodCounter = methods == null ? 0 : methods.length; done : for (int i = 0; i < methodCounter; i++) { AbstractMethodDeclaration method = methods[i]; if (method.isConstructor() && !method.isDefaultConstructor()) { hasConstructor = true; break done; } } if (!hasConstructor) { this.indexer.addDefaultConstructorDeclaration( typeInfo.name, this.packageName == null ? CharOperation.NO_CHAR : this.packageName, typeInfo.modifiers, getMoreExtraFlags(typeInfo.extraFlags)); } }
Example 2
Source File: RangeUtil.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 4 votes |
public static boolean containsIgnoredBody(AbstractMethodDeclaration method){ return !method.isDefaultConstructor() && !method.isClinit() && (method.modifiers & ExtraCompilerModifiers.AccSemicolonBody) == 0; }