本文整理汇总了Java中org.eclipse.jdt.core.dom.MethodRef.getQualifier方法的典型用法代码示例。如果您正苦于以下问题:Java MethodRef.getQualifier方法的具体用法?Java MethodRef.getQualifier怎么用?Java MethodRef.getQualifier使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.core.dom.MethodRef
的用法示例。
在下文中一共展示了MethodRef.getQualifier方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import org.eclipse.jdt.core.dom.MethodRef; //导入方法依赖的package包/类
@Override
public boolean visit(MethodRef node) {
IBinding binding= node.resolveBinding();
if (isSourceAccess(binding)) {
if (isMovedMember(binding)) {
if (node.getQualifier() != null)
rewrite(node, fTarget);
} else
rewrite(node, fSource);
} else if (isTargetAccess(binding)) {
// remove qualifier:
SimpleName replace= (SimpleName)fCuRewrite.getASTRewrite().createCopyTarget(node.getName());
fCuRewrite.getASTRewrite().replace(node, replace, null);
fCuRewrite.getImportRemover().registerRemovedNode(node);
}
return super.visit(node);
}
示例2: visit
import org.eclipse.jdt.core.dom.MethodRef; //导入方法依赖的package包/类
@Override
public boolean visit(MethodRef node) {
if (node.getQualifier() != null) {
node.getQualifier().accept(this);
}
this.fBuffer.append("#");//$NON-NLS-1$
node.getName().accept(this);
this.fBuffer.append("(");//$NON-NLS-1$
for (Iterator<MethodRefParameter> it= node.parameters().iterator(); it.hasNext();) {
MethodRefParameter e= it.next();
e.accept(this);
if (it.hasNext()) {
this.fBuffer.append(",");//$NON-NLS-1$
}
}
this.fBuffer.append(")");//$NON-NLS-1$
return false;
}
示例3: visit
import org.eclipse.jdt.core.dom.MethodRef; //导入方法依赖的package包/类
public boolean visit(MethodRef node) {
if (node.getQualifier() != null) {
node.getQualifier().accept(this);
}
this.buffer.append("#");//$NON-NLS-1$
node.getName().accept(this);
this.buffer.append("(");//$NON-NLS-1$
for (Iterator it = node.parameters().iterator(); it.hasNext(); ) {
MethodRefParameter e = (MethodRefParameter) it.next();
e.accept(this);
if (it.hasNext()) {
this.buffer.append(",");//$NON-NLS-1$
}
}
this.buffer.append(")");//$NON-NLS-1$
return false;
}
示例4: visit
import org.eclipse.jdt.core.dom.MethodRef; //导入方法依赖的package包/类
@Override
public boolean visit(MethodRef node) {
Name qualifier= node.getQualifier();
if (qualifier != null) {
typeRefFound(qualifier);
}
List<MethodRefParameter> list= node.parameters();
if (list != null) {
doVisitChildren(list); // visit MethodRefParameter with Type
}
return false;
}
示例5: visit
import org.eclipse.jdt.core.dom.MethodRef; //导入方法依赖的package包/类
@Override
public boolean visit(MethodRef node) {
Name qualifier = node.getQualifier();
if (qualifier != null) {
typeRefFound(qualifier);
}
List<MethodRefParameter> list = node.parameters();
if (list != null) {
doVisitChildren(list); // visit MethodRefParameter with Type
}
return false;
}
示例6: rewrite
import org.eclipse.jdt.core.dom.MethodRef; //导入方法依赖的package包/类
protected void rewrite(MethodRef node, ITypeBinding type) {
Name qualifier= node.getQualifier();
if (qualifier == null) {
ImportRewriteContext context= new ContextSensitiveImportRewriteContext(node, fCuRewrite.getImportRewrite());
Type result= fCuRewrite.getImportRewrite().addImport(type, fCuRewrite.getAST(), context);
fCuRewrite.getImportRemover().registerAddedImport(type.getQualifiedName());
qualifier= ASTNodeFactory.newName(fCuRewrite.getAST(), ASTFlattener.asString(result));
fCuRewrite.getASTRewrite().set(node, MethodRef.QUALIFIER_PROPERTY, qualifier, fCuRewrite.createGroupDescription(REFERENCE_UPDATE));
fNeedsImport= true;
} else {
rewriteName(qualifier, type);
}
fProcessed.add(node.getName());
}