@Override public boolean acceptContainer(IApiTypeContainer container) { return considerTypeContainer(container); }
kinds |= IApiSearchRequestor.INCLUDE_ILLEGAL_USE; UseSearchRequestor requestor = new UseSearchRequestor(ids, scope.toArray(new IApiElement[scope.size()]), kinds); List<String> jars = this.configuration.getAttribute(ApiUseLaunchDelegate.JAR_PATTERNS_LIST, (List<String>) null); String[] sjars = getStrings(jars); requestor.setJarPatterns(sjars); List<String> api = this.configuration.getAttribute(ApiUseLaunchDelegate.API_PATTERNS_LIST, (List<String>) null); String[] sapi = getStrings(api); String filterRoot = this.configuration.getAttribute(ApiUseLaunchDelegate.FILTER_ROOT, (String) null); requestor.setFilterRoot(filterRoot); List<String> internal = this.configuration.getAttribute(ApiUseLaunchDelegate.INTERNAL_PATTERNS_LIST, (List<String>) null); String[] sinternal = getStrings(internal);
@Override public boolean acceptReference(IReference reference) { try { IApiMember member = reference.getResolvedReference(); if (member != null) { IApiComponent component = member.getApiComponent(); if (!fComponentIds.contains(component.getSymbolicName()) || component.equals(reference.getMember().getApiComponent())) { return false; } if (isIllegalUse(reference) || (includesAPI() && includesInternal())) { return true; } IApiAnnotations annots = component.getApiDescription().resolveAnnotations(member.getHandle()); if (annots != null) { int vis = annots.getVisibility(); if (VisibilityModifiers.isAPI(vis) && includesAPI()) { return true; } else if (VisibilityModifiers.isPrivate(vis) && includesInternal()) { return true; } } } } catch (CoreException ce) { ApiPlugin.log(ce); } return false; }
@Override public boolean acceptComponent(IApiComponent component) { try { if (!component.isSystemComponent() && getScope().encloses(component)) { if (includesIllegalUse()) { fAnalyzer.buildProblemDetectors(component, ProblemDetectorBuilder.K_USE, null); } currentStore = component.getFilterStore(); antStore = antFilterRoot != null ? new AntFilterStore(antFilterRoot, component.getSymbolicName()) : null; return true; } } catch (CoreException ce) { // do nothing, return false } currentStore = null; return false; }
/** * Returns true if the given reference is an illegal usage reference iff * illegal use is part of the search mask. * * @param reference * @return true if the reference is illegal use false otherwise * @since 1.1 */ boolean isIllegalUse(IReference reference) { IApiProblemDetector[] detectors = fAnalyzer.getProblemDetectors(reference.getReferenceKind()); for (IApiProblemDetector detector : detectors) { if (detector.considerReference(reference)) { Reference ref = (Reference) reference; ref.setFlags(IReference.F_ILLEGAL); try { IApiProblem pb = ((AbstractProblemDetector) detector).checkAndCreateProblem(reference); if (pb != null && !isFiltered(pb)) { ref.addProblems(pb); } else { return false; } } catch (CoreException e) { ApiPlugin.log(e); } return true; } } return false; }
kinds |= IApiSearchRequestor.INCLUDE_ILLEGAL_USE; UseSearchRequestor requestor = new UseSearchRequestor(ids, (IApiElement[]) scope.toArray(new IApiElement[scope.size()]), kinds); List jars = this.configuration.getAttribute(ApiUseLaunchDelegate.JAR_PATTERNS_LIST, (List)null); String[] sjars = getStrings(jars); requestor.setJarPatterns(sjars); List api = this.configuration.getAttribute(ApiUseLaunchDelegate.API_PATTERNS_LIST, (List)null); String[] sapi = getStrings(api); String filterRoot = this.configuration.getAttribute(ApiUseLaunchDelegate.FILTER_ROOT, (String)null); requestor.setFilterRoot(filterRoot); List internal = this.configuration.getAttribute(ApiUseLaunchDelegate.INTERNAL_PATTERNS_LIST, (List)null); String[] sinternal = getStrings(internal);