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


Java MethodRefParameter.isVarargs方法代码示例

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


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

示例4: visit

import org.eclipse.jdt.core.dom.MethodRefParameter; //导入方法依赖的package包/类
@Override
public boolean visit(MethodRefParameter node) {
	node.getType().accept(this);
	if (node.getAST().apiLevel() >= JLS3) {
		if (node.isVarargs()) {
			this.fBuffer.append("...");//$NON-NLS-1$
		}
	}
	if (node.getName() != null) {
		this.fBuffer.append(" ");//$NON-NLS-1$
		node.getName().accept(this);
	}
	return false;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:15,代码来源:ASTFlattener.java

示例5: visit

import org.eclipse.jdt.core.dom.MethodRefParameter; //导入方法依赖的package包/类
public boolean visit(MethodRefParameter node) {
	node.getType().accept(this);
	if (node.getAST().apiLevel() >= JLS3) {
		if (node.isVarargs()) {
			this.buffer.append("...");//$NON-NLS-1$
		}
	}
	if (node.getName() != null) {
		this.buffer.append(" ");//$NON-NLS-1$
		node.getName().accept(this);
	}
	return false;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:14,代码来源:NaiveASTFlattener.java


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