本文整理汇总了Java中org.eclipse.jdt.core.dom.SuperMethodInvocation.NAME_PROPERTY属性的典型用法代码示例。如果您正苦于以下问题:Java SuperMethodInvocation.NAME_PROPERTY属性的具体用法?Java SuperMethodInvocation.NAME_PROPERTY怎么用?Java SuperMethodInvocation.NAME_PROPERTY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.jdt.core.dom.SuperMethodInvocation
的用法示例。
在下文中一共展示了SuperMethodInvocation.NAME_PROPERTY属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getInlineableMethodNode
private static ASTNode getInlineableMethodNode(ASTNode node, IJavaElement unit) {
if (node == null) return null;
switch (node.getNodeType()) {
case ASTNode.SIMPLE_NAME:
StructuralPropertyDescriptor locationInParent = node.getLocationInParent();
if (locationInParent == MethodDeclaration.NAME_PROPERTY) {
return node.getParent();
} else if (locationInParent == MethodInvocation.NAME_PROPERTY
|| locationInParent == SuperMethodInvocation.NAME_PROPERTY) {
return unit instanceof ICompilationUnit
? node.getParent()
: null; // don't start on invocations in binary
}
return null;
case ASTNode.EXPRESSION_STATEMENT:
node = ((ExpressionStatement) node).getExpression();
}
switch (node.getNodeType()) {
case ASTNode.METHOD_DECLARATION:
return node;
case ASTNode.METHOD_INVOCATION:
case ASTNode.SUPER_METHOD_INVOCATION:
case ASTNode.CONSTRUCTOR_INVOCATION:
return unit instanceof ICompilationUnit
? node
: null; // don't start on invocations in binary
}
return null;
}
示例2: shouldReport
@Override
protected boolean shouldReport(IProblem problem, CompilationUnit cu) {
if (!super.shouldReport(problem, cu))
return false;
ASTNode node= ASTNodeSearchUtil.getAstNode(cu, problem.getSourceStart(), problem.getSourceEnd() - problem.getSourceStart() + 1);
if (node instanceof Type) {
Type type= (Type) node;
if (problem.getID() == IProblem.UndefinedType && getClassName().equals(ASTNodes.getTypeName(type))) {
return false;
}
}
if (node instanceof Name) {
Name name= (Name) node;
if (problem.getID() == IProblem.ImportNotFound && getPackage().indexOf(name.getFullyQualifiedName()) != -1)
return false;
if (problem.getID() == IProblem.MissingTypeInMethod) {
StructuralPropertyDescriptor locationInParent= name.getLocationInParent();
String[] arguments= problem.getArguments();
if ((locationInParent == MethodInvocation.NAME_PROPERTY || locationInParent == SuperMethodInvocation.NAME_PROPERTY)
&& arguments.length > 3
&& arguments[3].endsWith(getClassName()))
return false;
}
}
return true;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:26,代码来源:IntroduceParameterObjectProcessor.java
示例3: getInlineableMethodNode
private static ASTNode getInlineableMethodNode(ASTNode node, IJavaElement unit) {
if (node == null)
return null;
switch (node.getNodeType()) {
case ASTNode.SIMPLE_NAME:
StructuralPropertyDescriptor locationInParent= node.getLocationInParent();
if (locationInParent == MethodDeclaration.NAME_PROPERTY) {
return node.getParent();
} else if (locationInParent == MethodInvocation.NAME_PROPERTY
|| locationInParent == SuperMethodInvocation.NAME_PROPERTY) {
return unit instanceof ICompilationUnit ? node.getParent() : null; // don't start on invocations in binary
}
return null;
case ASTNode.EXPRESSION_STATEMENT:
node= ((ExpressionStatement)node).getExpression();
}
switch (node.getNodeType()) {
case ASTNode.METHOD_DECLARATION:
return node;
case ASTNode.METHOD_INVOCATION:
case ASTNode.SUPER_METHOD_INVOCATION:
case ASTNode.CONSTRUCTOR_INVOCATION:
return unit instanceof ICompilationUnit ? node : null; // don't start on invocations in binary
}
return null;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:26,代码来源:RefactoringAvailabilityTester.java