当前位置: 首页>>代码示例>>Java>>正文


Java MethodBinding.isAbstract方法代码示例

本文整理汇总了Java中org.eclipse.jdt.internal.compiler.lookup.MethodBinding.isAbstract方法的典型用法代码示例。如果您正苦于以下问题:Java MethodBinding.isAbstract方法的具体用法?Java MethodBinding.isAbstract怎么用?Java MethodBinding.isAbstract使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jdt.internal.compiler.lookup.MethodBinding的用法示例。


在下文中一共展示了MethodBinding.isAbstract方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addProblemMethod

import org.eclipse.jdt.internal.compiler.lookup.MethodBinding; //导入方法依赖的package包/类
/**
 * INTERNAL USE-ONLY
 * Generate the byte for a problem method info that correspond to a boggus method.
 *
 * @param method org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration
 * @param methodBinding org.eclipse.jdt.internal.compiler.nameloopkup.MethodBinding
 * @param problems org.eclipse.jdt.internal.compiler.problem.Problem[]
 */
public void addProblemMethod(
	AbstractMethodDeclaration method,
	MethodBinding methodBinding,
	CategorizedProblem[] problems) {
	if (methodBinding.isAbstract() && methodBinding.declaringClass.isInterface()) {
		method.abort(ProblemSeverities.AbortType, null);
	}
	// always clear the strictfp/native/abstract bit for a problem method
	generateMethodInfoHeader(methodBinding, methodBinding.modifiers & ~(ClassFileConstants.AccStrictfp | ClassFileConstants.AccNative | ClassFileConstants.AccAbstract));
	int methodAttributeOffset = this.contentsOffset;
	int attributesNumber = generateMethodInfoAttributes(methodBinding);

	// Code attribute
	attributesNumber++;

	int codeAttributeOffset = this.contentsOffset;
	generateCodeAttributeHeader();
	this.codeStream.reset(method, this);
	String problemString = "" ; //$NON-NLS-1$
	int problemLine = 0;
	if (problems != null) {
		int max = problems.length;
		StringBuffer buffer = new StringBuffer(25);
		int count = 0;
		for (int i = 0; i < max; i++) {
			CategorizedProblem problem = problems[i];
			if ((problem != null)
				&& (problem.isError())
				&& (problem.getSourceStart() >= method.declarationSourceStart)
				&& (problem.getSourceEnd() <= method.declarationSourceEnd)) {
				buffer.append("\t"  +problem.getMessage() + "\n" ); //$NON-NLS-1$ //$NON-NLS-2$
				count++;
				if (problemLine == 0) {
					problemLine = problem.getSourceLineNumber();
				}
				problems[i] = null;
			}
		} // insert the top line afterwards, once knowing how many problems we have to consider
		if (count > 1) {
			buffer.insert(0, Messages.compilation_unresolvedProblems);
		} else {
			buffer.insert(0, Messages.compilation_unresolvedProblem);
		}
		problemString = buffer.toString();
	}

	// return codeStream.generateCodeAttributeForProblemMethod(comp.options.runtimeExceptionNameForCompileError, "")
	this.codeStream.generateCodeAttributeForProblemMethod(problemString);
	completeCodeAttributeForProblemMethod(
		method,
		methodBinding,
		codeAttributeOffset,
		((SourceTypeBinding) methodBinding.declaringClass)
			.scope
			.referenceCompilationUnit()
			.compilationResult
			.getLineSeparatorPositions(),
		problemLine);
	completeMethodInfo(methodBinding, methodAttributeOffset, attributesNumber);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:69,代码来源:ClassFile.java


注:本文中的org.eclipse.jdt.internal.compiler.lookup.MethodBinding.isAbstract方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。