本文整理汇总了Java中org.eclipse.jdt.internal.corext.util.JdtFlags.isVarargs方法的典型用法代码示例。如果您正苦于以下问题:Java JdtFlags.isVarargs方法的具体用法?Java JdtFlags.isVarargs怎么用?Java JdtFlags.isVarargs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.internal.corext.util.JdtFlags
的用法示例。
在下文中一共展示了JdtFlags.isVarargs方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkOriginalVarargs
import org.eclipse.jdt.internal.corext.util.JdtFlags; //导入方法依赖的package包/类
private RefactoringStatus checkOriginalVarargs() throws JavaModelException {
if (JdtFlags.isVarargs(fMethod)) fOldVarargIndex = fMethod.getNumberOfParameters() - 1;
List<ParameterInfo> notDeletedInfos = getNotDeletedInfos();
for (int i = 0; i < notDeletedInfos.size(); i++) {
ParameterInfo info = notDeletedInfos.get(i);
if (info.isOldVarargs() && !info.isNewVarargs())
return RefactoringStatus.createFatalErrorStatus(
Messages.format(
RefactoringCoreMessages.ChangeSignatureRefactoring_cannot_convert_vararg,
BasicElementLabels.getJavaElementName(info.getNewName())));
if (i != notDeletedInfos.size() - 1) {
// not the last parameter
if (info.isNewVarargs())
return RefactoringStatus.createFatalErrorStatus(
Messages.format(
RefactoringCoreMessages.ChangeSignatureRefactoring_vararg_must_be_last,
BasicElementLabels.getJavaElementName(info.getNewName())));
}
}
return null;
}
示例2: checkOriginalVarargs
import org.eclipse.jdt.internal.corext.util.JdtFlags; //导入方法依赖的package包/类
private RefactoringStatus checkOriginalVarargs() throws JavaModelException {
if (JdtFlags.isVarargs(fMethod))
fOldVarargIndex= fMethod.getNumberOfParameters() - 1;
List<ParameterInfo> notDeletedInfos= getNotDeletedInfos();
for (int i= 0; i < notDeletedInfos.size(); i++) {
ParameterInfo info= notDeletedInfos.get(i);
if (info.isOldVarargs() && ! info.isNewVarargs())
return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.ChangeSignatureRefactoring_cannot_convert_vararg, BasicElementLabels.getJavaElementName(info.getNewName())));
if (i != notDeletedInfos.size() - 1) {
// not the last parameter
if (info.isNewVarargs())
return RefactoringStatus.createFatalErrorStatus(Messages.format(RefactoringCoreMessages.ChangeSignatureRefactoring_vararg_must_be_last, BasicElementLabels.getJavaElementName(info.getNewName())));
}
}
return null;
}
示例3: checkVarargs
import org.eclipse.jdt.internal.corext.util.JdtFlags; //导入方法依赖的package包/类
private RefactoringStatus checkVarargs() throws JavaModelException {
RefactoringStatus result = checkOriginalVarargs();
if (result != null) return result;
if (fRippleMethods != null) {
for (int iRipple = 0; iRipple < fRippleMethods.length; iRipple++) {
IMethod rippleMethod = fRippleMethods[iRipple];
if (!JdtFlags.isVarargs(rippleMethod)) continue;
// Vararg method can override method that takes an array as last argument
fOldVarargIndex = rippleMethod.getNumberOfParameters() - 1;
List<ParameterInfo> notDeletedInfos = getNotDeletedInfos();
for (int i = 0; i < notDeletedInfos.size(); i++) {
ParameterInfo info = notDeletedInfos.get(i);
if (fOldVarargIndex != -1
&& info.getOldIndex() == fOldVarargIndex
&& !info.isNewVarargs()) {
String rippleMethodType = rippleMethod.getDeclaringType().getFullyQualifiedName('.');
String message =
Messages.format(
RefactoringCoreMessages.ChangeSignatureRefactoring_ripple_cannot_convert_vararg,
new Object[] {
BasicElementLabels.getJavaElementName(info.getNewName()),
BasicElementLabels.getJavaElementName(rippleMethodType)
});
return RefactoringStatus.createFatalErrorStatus(
message, JavaStatusContext.create(rippleMethod));
}
}
}
}
return null;
}
示例4: checkVarargs
import org.eclipse.jdt.internal.corext.util.JdtFlags; //导入方法依赖的package包/类
private RefactoringStatus checkVarargs() throws JavaModelException {
RefactoringStatus result= checkOriginalVarargs();
if (result != null)
return result;
if (fRippleMethods != null) {
for (int iRipple= 0; iRipple < fRippleMethods.length; iRipple++) {
IMethod rippleMethod= fRippleMethods[iRipple];
if (! JdtFlags.isVarargs(rippleMethod))
continue;
// Vararg method can override method that takes an array as last argument
fOldVarargIndex= rippleMethod.getNumberOfParameters() - 1;
List<ParameterInfo> notDeletedInfos= getNotDeletedInfos();
for (int i= 0; i < notDeletedInfos.size(); i++) {
ParameterInfo info= notDeletedInfos.get(i);
if (fOldVarargIndex != -1 && info.getOldIndex() == fOldVarargIndex && ! info.isNewVarargs()) {
String rippleMethodType= rippleMethod.getDeclaringType().getFullyQualifiedName('.');
String message= Messages.format(RefactoringCoreMessages.ChangeSignatureRefactoring_ripple_cannot_convert_vararg, new Object[] { BasicElementLabels.getJavaElementName(info.getNewName()), BasicElementLabels.getJavaElementName(rippleMethodType)});
return RefactoringStatus.createFatalErrorStatus(message, JavaStatusContext.create(rippleMethod));
}
}
}
}
return null;
}