本文整理汇总了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);
}
示例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);
}
示例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;
}
示例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;
}