• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java MethodRefParameter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.jdt.core.dom.MethodRefParameter的典型用法代码示例。如果您正苦于以下问题:Java MethodRefParameter类的具体用法?Java MethodRefParameter怎么用?Java MethodRefParameter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MethodRefParameter类属于org.eclipse.jdt.core.dom包,在下文中一共展示了MethodRefParameter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: changeParamgumentType

import org.eclipse.jdt.core.dom.MethodRefParameter; //导入依赖的package包/类
@Override
protected void changeParamgumentType(ParameterInfo info) {
  if (!(fNode instanceof MethodRef)) return;

  MethodRefParameter oldParam =
      (MethodRefParameter) ((MethodRef) fNode).parameters().get(info.getOldIndex());
  Type oldTypeNode = oldParam.getType();
  Type newTypeNode = createNewDocRefType(info);
  if (info.isNewVarargs()) {
    if (info.isOldVarargs() && !oldParam.isVarargs()) {
      // leave as array reference if old reference was not vararg
      newTypeNode = ASTNodeFactory.newArrayType(newTypeNode);
    } else {
      getASTRewrite()
          .set(oldParam, MethodRefParameter.VARARGS_PROPERTY, Boolean.TRUE, fDescription);
    }
  } else {
    if (oldParam.isVarargs()) {
      getASTRewrite()
          .set(oldParam, MethodRefParameter.VARARGS_PROPERTY, Boolean.FALSE, fDescription);
    }
  }

  getASTRewrite().replace(oldTypeNode, newTypeNode, fDescription);
  registerImportRemoveNode(oldTypeNode);
}
 
开发者ID:eclipse,项目名称:che,代码行数:27,代码来源:ChangeSignatureProcessor.java


示例2: changeParamgumentType

import org.eclipse.jdt.core.dom.MethodRefParameter; //导入依赖的package包/类
@Override
protected void changeParamgumentType(ParameterInfo info) {
	if (! (fNode instanceof MethodRef))
		return;

	MethodRefParameter oldParam= (MethodRefParameter) ((MethodRef) fNode).parameters().get(info.getOldIndex());
	Type oldTypeNode= oldParam.getType();
	Type newTypeNode= createNewDocRefType(info);
	if (info.isNewVarargs()) {
		if (info.isOldVarargs() && ! oldParam.isVarargs()) {
			// leave as array reference if old reference was not vararg
			newTypeNode= ASTNodeFactory.newArrayType(newTypeNode);
		} else {
			getASTRewrite().set(oldParam, MethodRefParameter.VARARGS_PROPERTY, Boolean.TRUE, fDescription);
		}
	} else {
		if (oldParam.isVarargs()) {
			getASTRewrite().set(oldParam, MethodRefParameter.VARARGS_PROPERTY, Boolean.FALSE, fDescription);
		}
	}

	getASTRewrite().replace(oldTypeNode, newTypeNode, fDescription);
	registerImportRemoveNode(oldTypeNode);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:25,代码来源:ChangeSignatureProcessor.java


示例3: createArguments

import org.eclipse.jdt.core.dom.MethodRefParameter; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void createArguments(final MethodDeclaration declaration, final List<? extends ASTNode> arguments, boolean methodInvocation) {
	Assert.isNotNull(declaration);
	Assert.isNotNull(arguments);
	SingleVariableDeclaration variable= null;
	final int size= declaration.parameters().size();
	for (int index= 0; index < size; index++) {
		variable= (SingleVariableDeclaration) declaration.parameters().get(index);

		if (methodInvocation) {
			// we are creating method invocation parameters
			final SimpleName expression= getAst().newSimpleName(variable.getName().getIdentifier());
			((List<Expression>) arguments).add(expression);
		} else {
			// we are creating type info for the javadoc
			final MethodRefParameter parameter= getAst().newMethodRefParameter();
			parameter.setType(ASTNodeFactory.newType(getAst(), variable));
			if ((index == size - 1) && declaration.isVarargs())
				parameter.setVarargs(true);
			((List<MethodRefParameter>) arguments).add(parameter);
		}
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:24,代码来源:DelegateMethodCreator.java


示例4: changeParamgumentType

import org.eclipse.jdt.core.dom.MethodRefParameter; //导入依赖的package包/类
@Override
protected void changeParamgumentType(ParameterInfo info) {
	if (! (fNode instanceof MethodRef))
		return;

	MethodRefParameter oldParam= (MethodRefParameter) ((MethodRef) fNode).parameters().get(info.getOldIndex());
	Type oldTypeNode= oldParam.getType();
	Type newTypeNode= createNewDocRefType(info);
	if (info.isNewVarargs()) {
		if (info.isOldVarargs() && ! oldParam.isVarargs()) {
			// leave as array reference of old reference was not vararg
			newTypeNode= getASTRewrite().getAST().newArrayType(newTypeNode);
		} else {
			getASTRewrite().set(oldParam, MethodRefParameter.VARARGS_PROPERTY, Boolean.TRUE, fDescription);
		}
	} else {
		if (oldParam.isVarargs()) {
			getASTRewrite().set(oldParam, MethodRefParameter.VARARGS_PROPERTY, Boolean.FALSE, fDescription);
		}
	}

	getASTRewrite().replace(oldTypeNode, newTypeNode, fDescription);
	registerImportRemoveNode(oldTypeNode);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:25,代码来源:ChangeSignatureProcessor.java


示例5: visit

import org.eclipse.jdt.core.dom.MethodRefParameter; //导入依赖的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;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:19,代码来源:ASTFlattener.java


示例6: visit

import org.eclipse.jdt.core.dom.MethodRefParameter; //导入依赖的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;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:18,代码来源:NaiveASTFlattener.java


示例7: visit

import org.eclipse.jdt.core.dom.MethodRefParameter; //导入依赖的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;
}
 
开发者ID:eclipse,项目名称:eclipse.jdt.ls,代码行数:13,代码来源:ImportReferencesCollector.java


示例8: visit

import org.eclipse.jdt.core.dom.MethodRefParameter; //导入依赖的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;
}
 
开发者ID:eclipse,项目名称:che,代码行数:13,代码来源:ImportReferencesCollector.java


示例9: createNewMethodRefParameter

import org.eclipse.jdt.core.dom.MethodRefParameter; //导入依赖的package包/类
private MethodRefParameter createNewMethodRefParameter(ParameterInfo info) {
  MethodRefParameter newP = getASTRewrite().getAST().newMethodRefParameter();

  // only add name iff first parameter already has a name:
  List<? extends ASTNode> parameters = getParamgumentsRewrite().getOriginalList();
  if (parameters.size() > 0)
    if (((MethodRefParameter) parameters.get(0)).getName() != null)
      newP.setName(getASTRewrite().getAST().newSimpleName(info.getNewName()));

  newP.setType(createNewDocRefType(info));
  newP.setVarargs(info.isNewVarargs());
  return newP;
}
 
开发者ID:eclipse,项目名称:che,代码行数:14,代码来源:ChangeSignatureProcessor.java


示例10: changeParamgumentName

import org.eclipse.jdt.core.dom.MethodRefParameter; //导入依赖的package包/类
@Override
protected void changeParamgumentName(ParameterInfo info) {
  if (!(fNode instanceof MethodRef)) return;

  MethodRefParameter oldParam =
      (MethodRefParameter) ((MethodRef) fNode).parameters().get(info.getOldIndex());
  SimpleName oldParamName = oldParam.getName();
  if (oldParamName != null)
    getASTRewrite()
        .set(oldParamName, SimpleName.IDENTIFIER_PROPERTY, info.getNewName(), fDescription);
}
 
开发者ID:eclipse,项目名称:che,代码行数:12,代码来源:ChangeSignatureProcessor.java


示例11: createNewMethodRefParameter

import org.eclipse.jdt.core.dom.MethodRefParameter; //导入依赖的package包/类
private MethodRefParameter createNewMethodRefParameter(ParameterInfo info) {
	MethodRefParameter newP= getASTRewrite().getAST().newMethodRefParameter();

	// only add name iff first parameter already has a name:
	List<? extends ASTNode> parameters= getParamgumentsRewrite().getOriginalList();
	if (parameters.size() > 0)
		if (((MethodRefParameter) parameters.get(0)).getName() != null)
			newP.setName(getASTRewrite().getAST().newSimpleName(info.getNewName()));

	newP.setType(createNewDocRefType(info));
	newP.setVarargs(info.isNewVarargs());
	return newP;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:14,代码来源:ChangeSignatureProcessor.java


示例12: changeParamgumentName

import org.eclipse.jdt.core.dom.MethodRefParameter; //导入依赖的package包/类
@Override
protected void changeParamgumentName(ParameterInfo info) {
	if (! (fNode instanceof MethodRef))
		return;

	MethodRefParameter oldParam= (MethodRefParameter) ((MethodRef) fNode).parameters().get(info.getOldIndex());
	SimpleName oldParamName= oldParam.getName();
	if (oldParamName != null)
		getASTRewrite().set(oldParamName, SimpleName.IDENTIFIER_PROPERTY, info.getNewName(), fDescription);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:11,代码来源:ChangeSignatureProcessor.java


示例13: createNewParamgument

import org.eclipse.jdt.core.dom.MethodRefParameter; //导入依赖的package包/类
@Override
protected MethodRefParameter createNewParamgument(
    ParameterInfo info, List<ParameterInfo> parameterInfos, List<MethodRefParameter> nodes) {
  return createNewMethodRefParameter(info);
}
 
开发者ID:eclipse,项目名称:che,代码行数:6,代码来源:ChangeSignatureProcessor.java


示例14: endVisit

import org.eclipse.jdt.core.dom.MethodRefParameter; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void endVisit(MethodRefParameter node) {
	logger.warn("Method endVisitMethodRefParameter for " + node + " for " + node + " not implemented!");
	super.endVisit(node);
}
 
开发者ID:EvoSuite,项目名称:evosuite,代码行数:7,代码来源:LoggingVisitor.java


示例15: visit

import org.eclipse.jdt.core.dom.MethodRefParameter; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public boolean visit(MethodRefParameter node) {
	logger.warn("Method visitMethodRefParameter for " + node + " not implemented!");
	return super.visit(node);
}
 
开发者ID:EvoSuite,项目名称:evosuite,代码行数:7,代码来源:LoggingVisitor.java


示例16: visit

import org.eclipse.jdt.core.dom.MethodRefParameter; //导入依赖的package包/类
@Override
public boolean visit(final MethodRefParameter node) {
	return false;
}
 
开发者ID:Beagle-PSE,项目名称:Beagle,代码行数:5,代码来源:NotRecursingAstVisitor.java


示例17: visit

import org.eclipse.jdt.core.dom.MethodRefParameter; //导入依赖的package包/类
@Override
public boolean visit(final MethodRefParameter node) {
	// will never be visited
	assert false;
	return false;
}
 
开发者ID:Beagle-PSE,项目名称:Beagle,代码行数:7,代码来源:InstrumentableAstNodeLister.java


示例18: createNewParamgument

import org.eclipse.jdt.core.dom.MethodRefParameter; //导入依赖的package包/类
@Override
protected MethodRefParameter createNewParamgument(ParameterInfo info, List<ParameterInfo> parameterInfos, List<MethodRefParameter> nodes) {
	return createNewMethodRefParameter(info);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:5,代码来源:ChangeSignatureProcessor.java


示例19: visit

import org.eclipse.jdt.core.dom.MethodRefParameter; //导入依赖的package包/类
@Override
public boolean visit(MethodRefParameter node) {
	if (node.subtreeMatch(fMatcher, fNodeToMatch))
		return matches(node);
	return super.visit(node);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:7,代码来源:AstMatchingNodeFinder.java


示例20: endVisit

import org.eclipse.jdt.core.dom.MethodRefParameter; //导入依赖的package包/类
@Override
public void endVisit(MethodRefParameter node) {
	endVisitNode(node);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:5,代码来源:GenericVisitor.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SnapshotDiffReportProto类代码示例发布时间:2022-05-22
下一篇:
Java IDetachable类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap