本文整理汇总了Java中org.eclipse.jdt.internal.corext.util.JdtFlags.isNative方法的典型用法代码示例。如果您正苦于以下问题:Java JdtFlags.isNative方法的具体用法?Java JdtFlags.isNative怎么用?Java JdtFlags.isNative使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.internal.corext.util.JdtFlags
的用法示例。
在下文中一共展示了JdtFlags.isNative方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkNativeMethods
import org.eclipse.jdt.internal.corext.util.JdtFlags; //导入方法依赖的package包/类
private RefactoringStatus checkNativeMethods() throws JavaModelException {
RefactoringStatus result = new RefactoringStatus();
for (int i = 0; i < fRippleMethods.length; i++) {
if (JdtFlags.isNative(fRippleMethods[i])) {
String message =
Messages.format(
RefactoringCoreMessages.ChangeSignatureRefactoring_native,
new String[] {
JavaElementUtil.createMethodSignature(fRippleMethods[i]),
BasicElementLabels.getJavaElementName(
fRippleMethods[i].getDeclaringType().getFullyQualifiedName('.'))
});
result.addError(message, JavaStatusContext.create(fRippleMethods[i]));
}
}
return result;
}
示例2: checkInitialConditions
import org.eclipse.jdt.internal.corext.util.JdtFlags; //导入方法依赖的package包/类
@Override
public RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException {
if (!fMethod.exists()) {
String message =
Messages.format(
RefactoringCoreMessages.RenameMethodRefactoring_deleted,
BasicElementLabels.getFileName(fMethod.getCompilationUnit()));
return RefactoringStatus.createFatalErrorStatus(message);
}
RefactoringStatus result = Checks.checkAvailability(fMethod);
if (result.hasFatalError()) return result;
result.merge(Checks.checkIfCuBroken(fMethod));
if (JdtFlags.isNative(fMethod))
result.addError(RefactoringCoreMessages.RenameMethodRefactoring_no_native);
return result;
}
示例3: isExtractSupertypeAvailable
import org.eclipse.jdt.internal.corext.util.JdtFlags; //导入方法依赖的package包/类
public static boolean isExtractSupertypeAvailable(IMember member) throws JavaModelException {
if (!member.exists()) return false;
final int type = member.getElementType();
if (type != IJavaElement.METHOD && type != IJavaElement.FIELD && type != IJavaElement.TYPE)
return false;
if (JdtFlags.isEnum(member) && type != IJavaElement.TYPE) return false;
if (!Checks.isAvailable(member)) return false;
if (member instanceof IMethod) {
final IMethod method = (IMethod) member;
if (method.isConstructor()) return false;
if (JdtFlags.isNative(method)) return false;
member = method.getDeclaringType();
} else if (member instanceof IField) {
member = member.getDeclaringType();
}
if (member instanceof IType) {
if (JdtFlags.isEnum(member) || JdtFlags.isAnnotation(member)) return false;
if (member.getDeclaringType() != null && !JdtFlags.isStatic(member)) return false;
if (((IType) member).isAnonymous())
return false; // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=253727
if (((IType) member).isLambda()) return false;
}
return true;
}
示例4: isPullUpAvailable
import org.eclipse.jdt.internal.corext.util.JdtFlags; //导入方法依赖的package包/类
public static boolean isPullUpAvailable(IMember member) throws JavaModelException {
if (!member.exists()) return false;
final int type = member.getElementType();
if (type != IJavaElement.METHOD && type != IJavaElement.FIELD && type != IJavaElement.TYPE)
return false;
if (JdtFlags.isEnum(member) && type != IJavaElement.TYPE) return false;
if (!Checks.isAvailable(member)) return false;
if (member instanceof IType) {
if (!JdtFlags.isStatic(member) && !JdtFlags.isEnum(member) && !JdtFlags.isAnnotation(member))
return false;
}
if (member instanceof IMethod) {
final IMethod method = (IMethod) member;
if (method.isConstructor()) return false;
if (JdtFlags.isNative(method)) return false;
final IType declaring = method.getDeclaringType();
if (declaring != null && declaring.isAnnotation()) return false;
}
return true;
}
示例5: isPushDownAvailable
import org.eclipse.jdt.internal.corext.util.JdtFlags; //导入方法依赖的package包/类
public static boolean isPushDownAvailable(final IMember member) throws JavaModelException {
if (!member.exists()) return false;
final int type = member.getElementType();
if (type != IJavaElement.METHOD && type != IJavaElement.FIELD) return false;
if (JdtFlags.isEnum(member)) return false;
if (!Checks.isAvailable(member)) return false;
if (JdtFlags.isStatic(member)) return false;
if (type == IJavaElement.METHOD) {
final IMethod method = (IMethod) member;
if (method.isConstructor()) return false;
if (JdtFlags.isNative(method)) return false;
final IType declaring = method.getDeclaringType();
if (declaring != null && declaring.isAnnotation()) return false;
}
return true;
}
示例6: checkNativeMovedMethods
import org.eclipse.jdt.internal.corext.util.JdtFlags; //导入方法依赖的package包/类
private RefactoringStatus checkNativeMovedMethods(IProgressMonitor pm) throws JavaModelException{
pm.beginTask(RefactoringCoreMessages.MoveMembersRefactoring_checking, fMembersToMove.length);
RefactoringStatus result= new RefactoringStatus();
for (int i= 0; i < fMembersToMove.length; i++) {
if (fMembersToMove[i].getElementType() != IJavaElement.METHOD)
continue;
if (! JdtFlags.isNative(fMembersToMove[i]))
continue;
String message= Messages.format(RefactoringCoreMessages.MoveMembersRefactoring_native,
JavaElementUtil.createMethodSignature((IMethod)fMembersToMove[i]));
result.addWarning(message, JavaStatusContext.create(fMembersToMove[i]));
pm.worked(1);
}
pm.done();
return result;
}
示例7: checkInitialConditions
import org.eclipse.jdt.internal.corext.util.JdtFlags; //导入方法依赖的package包/类
@Override
public RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException {
if (! fMethod.exists()){
String message= Messages.format(RefactoringCoreMessages.RenameMethodRefactoring_deleted,
BasicElementLabels.getFileName(fMethod.getCompilationUnit()));
return RefactoringStatus.createFatalErrorStatus(message);
}
RefactoringStatus result= Checks.checkAvailability(fMethod);
if (result.hasFatalError())
return result;
result.merge(Checks.checkIfCuBroken(fMethod));
if (JdtFlags.isNative(fMethod))
result.addError(RefactoringCoreMessages.RenameMethodRefactoring_no_native);
return result;
}
示例8: checkRelatedMethods
import org.eclipse.jdt.internal.corext.util.JdtFlags; //导入方法依赖的package包/类
private RefactoringStatus checkRelatedMethods() throws CoreException {
RefactoringStatus result= new RefactoringStatus();
for (Iterator<IMethod> iter= fMethodsToRename.iterator(); iter.hasNext(); ) {
IMethod method= iter.next();
result.merge(Checks.checkIfConstructorName(method, getNewElementName(), method.getDeclaringType().getElementName()));
String[] msgData= new String[]{BasicElementLabels.getJavaElementName(method.getElementName()), BasicElementLabels.getJavaElementName(method.getDeclaringType().getFullyQualifiedName('.'))};
if (! method.exists()){
result.addFatalError(Messages.format(RefactoringCoreMessages.RenameMethodRefactoring_not_in_model, msgData));
continue;
}
if (method.isBinary())
result.addFatalError(Messages.format(RefactoringCoreMessages.RenameMethodRefactoring_no_binary, msgData));
if (method.isReadOnly())
result.addFatalError(Messages.format(RefactoringCoreMessages.RenameMethodRefactoring_no_read_only, msgData));
if (JdtFlags.isNative(method))
result.addError(Messages.format(RefactoringCoreMessages.RenameMethodRefactoring_no_native_1, msgData));
}
return result;
}
示例9: isPullUpAvailable
import org.eclipse.jdt.internal.corext.util.JdtFlags; //导入方法依赖的package包/类
public static boolean isPullUpAvailable(IMember member) throws JavaModelException {
if (!member.exists())
return false;
final int type= member.getElementType();
if (type != IJavaElement.METHOD && type != IJavaElement.FIELD && type != IJavaElement.TYPE)
return false;
if (JdtFlags.isEnum(member) && type != IJavaElement.TYPE)
return false;
if (!Checks.isAvailable(member))
return false;
if (member instanceof IType) {
if (!JdtFlags.isStatic(member) && !JdtFlags.isEnum(member) && !JdtFlags.isAnnotation(member))
return false;
}
if (member instanceof IMethod) {
final IMethod method= (IMethod) member;
if (method.isConstructor())
return false;
if (JdtFlags.isNative(method))
return false;
final IType declaring= method.getDeclaringType();
if (declaring != null && declaring.isAnnotation())
return false;
}
return true;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:27,代码来源:RefactoringAvailabilityTester.java
示例10: isPushDownAvailable
import org.eclipse.jdt.internal.corext.util.JdtFlags; //导入方法依赖的package包/类
public static boolean isPushDownAvailable(final IMember member) throws JavaModelException {
if (!member.exists())
return false;
final int type= member.getElementType();
if (type != IJavaElement.METHOD && type != IJavaElement.FIELD)
return false;
if (JdtFlags.isEnum(member))
return false;
if (!Checks.isAvailable(member))
return false;
if (JdtFlags.isStatic(member))
return false;
if (type == IJavaElement.METHOD) {
final IMethod method= (IMethod) member;
if (method.isConstructor())
return false;
if (JdtFlags.isNative(method))
return false;
final IType declaring= method.getDeclaringType();
if (declaring != null && declaring.isAnnotation())
return false;
}
return true;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:25,代码来源:RefactoringAvailabilityTester.java
示例11: isInterfaceMigrationAvailable
import org.eclipse.jdt.internal.corext.util.JdtFlags; //导入方法依赖的package包/类
public static boolean isInterfaceMigrationAvailable(IMethod method, boolean allowConcreteClasses,
Optional<IProgressMonitor> monitor) throws JavaModelException {
if (!Checks.isAvailable(method))
return false;
if (method.isConstructor())
return false;
if (JdtFlags.isNative(method))
return false;
if (JdtFlags.isStatic(method))
return false;
if (JdtFlags.isAbstract(method))
return false;
// TODO: Should this be here?
if (JdtFlags.isSynchronized(method))
return false;
// TODO: Should this be here?
if (JdtFlags.isFinal(method))
return false;
if (method.getResource().isDerived(IResource.CHECK_ANCESTORS))
return false;
final IType declaring = method.getDeclaringType();
if (declaring != null)
if (declaring.isInterface())
return false; // Method is already in an interface
else if (!allowConcreteClasses && !Flags.isAbstract(declaring.getFlags()))
return false; // no concrete types allowed.
// ensure that there is a target method.
IMethod targetMethod = MigrateSkeletalImplementationToInterfaceRefactoringProcessor.getTargetMethod(method,
monitor);
if (targetMethod == null) // no possible target.
return false;
return true;
}
开发者ID:ponder-lab,项目名称:Migrate-Skeletal-Implementation-to-Interface-Refactoring,代码行数:37,代码来源:RefactoringAvailabilityTester.java
示例12: classesDeclareOverridingNativeMethod
import org.eclipse.jdt.internal.corext.util.JdtFlags; //导入方法依赖的package包/类
private boolean classesDeclareOverridingNativeMethod(IType[] classes) throws CoreException {
for (int i = 0; i < classes.length; i++) {
IMethod[] methods = classes[i].getMethods();
for (int j = 0; j < methods.length; j++) {
if ((!methods[j].equals(getMethod()))
&& (JdtFlags.isNative(methods[j]))
&& (null != Checks.findSimilarMethod(getMethod(), new IMethod[] {methods[j]})))
return true;
}
}
return false;
}
示例13: checkRelatedMethods
import org.eclipse.jdt.internal.corext.util.JdtFlags; //导入方法依赖的package包/类
private RefactoringStatus checkRelatedMethods() throws CoreException {
RefactoringStatus result = new RefactoringStatus();
for (Iterator<IMethod> iter = fMethodsToRename.iterator(); iter.hasNext(); ) {
IMethod method = iter.next();
result.merge(
Checks.checkIfConstructorName(
method, getNewElementName(), method.getDeclaringType().getElementName()));
String[] msgData =
new String[] {
BasicElementLabels.getJavaElementName(method.getElementName()),
BasicElementLabels.getJavaElementName(
method.getDeclaringType().getFullyQualifiedName('.'))
};
if (!method.exists()) {
result.addFatalError(
Messages.format(RefactoringCoreMessages.RenameMethodRefactoring_not_in_model, msgData));
continue;
}
if (method.isBinary())
result.addFatalError(
Messages.format(RefactoringCoreMessages.RenameMethodRefactoring_no_binary, msgData));
if (method.isReadOnly())
result.addFatalError(
Messages.format(RefactoringCoreMessages.RenameMethodRefactoring_no_read_only, msgData));
if (JdtFlags.isNative(method))
result.addError(
Messages.format(RefactoringCoreMessages.RenameMethodRefactoring_no_native_1, msgData));
}
return result;
}
示例14: mustAnalyzeAstOfDeclaringCu
import org.eclipse.jdt.internal.corext.util.JdtFlags; //导入方法依赖的package包/类
private boolean mustAnalyzeAstOfDeclaringCu() throws JavaModelException{
if (JdtFlags.isAbstract(getMethod()))
return false;
else if (JdtFlags.isNative(getMethod()))
return false;
else if (getMethod().getDeclaringType().isInterface())
return false;
else
return true;
}
示例15: checkNativeMethods
import org.eclipse.jdt.internal.corext.util.JdtFlags; //导入方法依赖的package包/类
private RefactoringStatus checkNativeMethods() throws JavaModelException{
RefactoringStatus result= new RefactoringStatus();
for (int i= 0; i < fRippleMethods.length; i++) {
if (JdtFlags.isNative(fRippleMethods[i])){
String message= Messages.format(RefactoringCoreMessages.ChangeSignatureRefactoring_native,
new String[]{JavaElementUtil.createMethodSignature(fRippleMethods[i]), BasicElementLabels.getJavaElementName(fRippleMethods[i].getDeclaringType().getFullyQualifiedName('.'))});
result.addError(message, JavaStatusContext.create(fRippleMethods[i]));
}
}
return result;
}