本文整理汇总了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);
}
}
}
}
}
示例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);
}
示例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);
}
示例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);
}
示例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());
}