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


Java MethodBinding.readableName方法代码示例

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


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

示例1: generateMissingAbstractMethods

import org.eclipse.jdt.internal.compiler.lookup.MethodBinding; //导入方法依赖的package包/类
/**
 * INTERNAL USE-ONLY
 * Generate the byte for problem method infos that correspond to missing abstract methods.
 * http://dev.eclipse.org/bugs/show_bug.cgi?id=3179
 *
 * @param methodDeclarations Array of all missing abstract methods
 */
public void generateMissingAbstractMethods(MethodDeclaration[] methodDeclarations, CompilationResult compilationResult) {
	if (methodDeclarations != null) {
		TypeDeclaration currentDeclaration = this.referenceBinding.scope.referenceContext;
		int typeDeclarationSourceStart = currentDeclaration.sourceStart();
		int typeDeclarationSourceEnd = currentDeclaration.sourceEnd();
		for (int i = 0, max = methodDeclarations.length; i < max; i++) {
			MethodDeclaration methodDeclaration = methodDeclarations[i];
			MethodBinding methodBinding = methodDeclaration.binding;
			 String readableName = new String(methodBinding.readableName());
			 CategorizedProblem[] problems = compilationResult.problems;
			 int problemsCount = compilationResult.problemCount;
			for (int j = 0; j < problemsCount; j++) {
				CategorizedProblem problem = problems[j];
				if (problem != null
						&& problem.getID() == IProblem.AbstractMethodMustBeImplemented
						&& problem.getMessage().indexOf(readableName) != -1
						&& problem.getSourceStart() >= typeDeclarationSourceStart
						&& problem.getSourceEnd() <= typeDeclarationSourceEnd) {
					// we found a match
					addMissingAbstractProblemMethod(methodDeclaration, methodBinding, problem, compilationResult);
				}
			}
		}
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:33,代码来源:ClassFile.java

示例2: cannotImplementIncompatibleNullness

import org.eclipse.jdt.internal.compiler.lookup.MethodBinding; //导入方法依赖的package包/类
public void cannotImplementIncompatibleNullness(MethodBinding currentMethod, MethodBinding inheritedMethod) {
	int sourceStart = 0, sourceEnd = 0;
	if (this.referenceContext instanceof TypeDeclaration) {
		sourceStart = ((TypeDeclaration) this.referenceContext).sourceStart;
		sourceEnd =   ((TypeDeclaration) this.referenceContext).sourceEnd;
	}
	String[] problemArguments = {
			new String(currentMethod.readableName()),
			new String(currentMethod.declaringClass.readableName()),
			new String(inheritedMethod.declaringClass.readableName())
		};
	String[] messageArguments = {
			new String(currentMethod.shortReadableName()),
			new String(currentMethod.declaringClass.shortReadableName()),
			new String(inheritedMethod.declaringClass.shortReadableName())
		};
	this.handle(
			IProblem.CannotImplementIncompatibleNullness,
			problemArguments,
			messageArguments,
			sourceStart,
			sourceEnd);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:24,代码来源:ProblemReporter.java

示例3: messageSendPotentialNullReference

import org.eclipse.jdt.internal.compiler.lookup.MethodBinding; //导入方法依赖的package包/类
public void messageSendPotentialNullReference(MethodBinding method, ASTNode location) {
	String[] arguments = new String[] {new String(method.readableName())};
	this.handle(
		IProblem.PotentialNullMessageSendReference,
		arguments,
		arguments,
		location.sourceStart,
		location.sourceEnd);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:10,代码来源:ProblemReporter.java

示例4: messageSendRedundantCheckOnNonNull

import org.eclipse.jdt.internal.compiler.lookup.MethodBinding; //导入方法依赖的package包/类
public void messageSendRedundantCheckOnNonNull(MethodBinding method, ASTNode location) {
	String[] arguments = new String[] {new String(method.readableName())  };
	this.handle(
		IProblem.RedundantNullCheckOnNonNullMessageSend,
		arguments,
		arguments,
		location.sourceStart,
		location.sourceEnd);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:10,代码来源:ProblemReporter.java

示例5: methodBindingToString

import org.eclipse.jdt.internal.compiler.lookup.MethodBinding; //导入方法依赖的package包/类
/**
 * Constructs a String representation of the given MethodBinding. The
 * notation is <declaringClassFQN>#<method signature>.
 */
public static String methodBindingToString(MethodBinding methodBinding) {
	MethodBinding original = methodBinding.original();
	ReferenceBinding declaringClass = original.declaringClass;
	return getFullQualifiedClassName(declaringClass) + "#"
			+ new String(original.readableName());
}
 
开发者ID:vimaier,项目名称:conqat,代码行数:11,代码来源:EcjUtils.java


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