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


Java MethodRefParameter类代码示例

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


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


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