public boolean isAbstract() { try { return Flags.isAbstract(this.getJdtMember().getFlags()); } catch (JavaModelException ex) { throw new RuntimeException(ex); } }
private static boolean isTestImplementor(IType type) throws JavaModelException { if (!Flags.isAbstract(type.getFlags()) && CoreTestSearchEngine.isTestImplementor(type)) { return true; } return false; } }
public static boolean isAbstract(IMember member) throws JavaModelException{ if (isInterfaceOrAnnotationMethod(member)) return true; return Flags.isAbstract(member.getFlags()); }
private boolean isAbstractClass(IType res) { try { if (res.isClass() && Flags.isAbstract(res.getFlags())) return true; } catch (JavaModelException e) { //ignore } return false; }
private static boolean isTestImplementor(IType type) throws JavaModelException { if (!Flags.isAbstract(type.getFlags()) && CoreTestSearchEngine.isTestImplementor(type)) { return true; } return false; } }
private boolean isCacheableRHS(IType type) throws JavaModelException { return !type.isInterface() && !Flags.isAbstract(type.getFlags()); }
private boolean isCacheableRHS(IType type) throws JavaModelException { return !type.isInterface() && !Flags.isAbstract(type.getFlags()); }
private boolean isCacheableRHS(IType type) throws JavaModelException { return !type.isInterface() && !Flags.isAbstract(type.getFlags()); }
private ImageDescriptor getOverlayFromFlags(int flags) { if (Flags.isAnnotation(flags)) { return JavaPluginImages.DESC_OVR_ANNOTATION; } else if (Flags.isEnum(flags)) { return JavaPluginImages.DESC_OVR_ENUM; } else if (Flags.isInterface(flags)) { return JavaPluginImages.DESC_OVR_INTERFACE; } else if (/* is class */ Flags.isAbstract(flags)) { return JavaPluginImages.DESC_OVR_ABSTRACT_CLASS; } return null; }
public static void findTestImplementorClasses(ITypeHierarchy typeHierarchy, IType testInterface, IRegion region, Set<IType> result) throws JavaModelException { IType[] subtypes= typeHierarchy.getAllSubtypes(testInterface); for (int i= 0; i < subtypes.length; i++) { IType type= subtypes[i]; int cachedFlags= typeHierarchy.getCachedFlags(type); if (!Flags.isInterface(cachedFlags) && !Flags.isAbstract(cachedFlags) // do the cheaper tests first && region.contains(type) && CoreTestSearchEngine.isAccessibleClass(type)) { result.add(type); } } }
public static void findTestImplementorClasses(ITypeHierarchy typeHierarchy, IType testInterface, IRegion region, Set result) throws JavaModelException { IType[] subtypes= typeHierarchy.getAllSubtypes(testInterface); for (int i= 0; i < subtypes.length; i++) { IType type= subtypes[i]; int cachedFlags= typeHierarchy.getCachedFlags(type); if (!Flags.isInterface(cachedFlags) && !Flags.isAbstract(cachedFlags) // do the cheaper tests first && region.contains(type) && CoreTestSearchEngine.isAccessibleClass(type)) { result.add(type); } } }
public static boolean isMethod(IMethod method, boolean onlyPublicMethod) { try { int flags = method.getFlags(); if (onlyPublicMethod && !Flags.isPublic(flags)) { return false; } // 'V' is void signature return !(method.isConstructor() || Flags.isAbstract(flags) || Flags.isStatic(flags) || !"V".equals(method.getReturnType())); } catch (JavaModelException e) { // ignore return false; } }
/** * Hook method that gets called when the modifiers have changed. The method validates * the modifiers and returns the status of the validation. * <p> * Subclasses may extend this method to perform their own validation. * </p> * * @return the status of the validation */ protected IStatus modifiersChanged() { StatusInfo status= new StatusInfo(); int modifiers= getModifiers(); if (Flags.isFinal(modifiers) && Flags.isAbstract(modifiers)) { status.setError(NewWizardMessages.NewTypeWizardPage_error_ModifiersFinalAndAbstract); } return status; }
/** * Hook method that gets called when the modifiers have changed. The method validates * the modifiers and returns the status of the validation. * <p> * Subclasses may extend this method to perform their own validation. * </p> * * @return the status of the validation */ protected IStatus modifiersChanged() { StatusInfo status= new StatusInfo(); int modifiers= getModifiers(); if (Flags.isFinal(modifiers) && Flags.isAbstract(modifiers)) { status.setError(NewWizardMessages.NewTypeWizardPage_error_ModifiersFinalAndAbstract); } return status; }
/** * Hook method that gets called when the modifiers have changed. The method validates * the modifiers and returns the status of the validation. * <p> * Subclasses may extend this method to perform their own validation. * </p> * * @return the status of the validation */ protected IStatus modifiersChanged() { StatusInfo status= new StatusInfo(); int modifiers= getModifiers(); if (Flags.isFinal(modifiers) && Flags.isAbstract(modifiers)) { status.setError(NewWizardMessages.NewTypeWizardPage_error_ModifiersFinalAndAbstract); } return status; }
/** * Hook method that gets called when the modifiers have changed. The method validates * the modifiers and returns the status of the validation. * <p> * Subclasses may extend this method to perform their own validation. * </p> * * @return the status of the validation */ protected IStatus modifiersChanged() { StatusInfo status= new StatusInfo(); int modifiers= getModifiers(); if (Flags.isFinal(modifiers) && Flags.isAbstract(modifiers)) { status.setError(NewWizardMessages.NewTypeWizardPage_error_ModifiersFinalAndAbstract); } return status; }
public static boolean isAbstract(IMember member) throws JavaModelException{ int flags= member.getFlags(); if (!member.isBinary() && isInterfaceOrAnnotationMethod(member)) { return !Flags.isStatic(flags) && !Flags.isDefaultMethod(flags); } return Flags.isAbstract(flags); }
public static boolean isAbstract(IMember member) throws JavaModelException{ int flags= member.getFlags(); if (!member.isBinary() && isInterfaceOrAnnotationMethod(member)) { return !Flags.isPrivate(flags) && !Flags.isStatic(flags) && !Flags.isDefaultMethod(flags); } return Flags.isAbstract(flags); }
public static boolean isAbstract(IMember member) throws JavaModelException{ int flags= member.getFlags(); if (!member.isBinary() && isInterfaceOrAnnotationMethod(member)) { return !Flags.isPrivate(flags) && !Flags.isStatic(flags) && !Flags.isDefaultMethod(flags); } return Flags.isAbstract(flags); }
private static boolean isTestableClass(IType type) throws JavaModelException { int flags = type.getFlags(); if (Flags.isInterface(flags) || Flags.isAbstract(flags)) { return false; } IJavaElement parent = type.getParent(); while (true) { if (parent instanceof ICompilationUnit || parent instanceof IClassFile) { return true; } if (!(parent instanceof IType) || !Flags.isStatic(flags) || !Flags.isPublic(flags)) { return false; } flags = ((IType) parent).getFlags(); parent = parent.getParent(); } }