component = (SkippedComponent) element; comp = doc.createElement(IApiXmlConstants.ELEMENT_COMPONENT); comp.setAttribute(IApiXmlConstants.ATTR_ID, component.getComponentId()); comp.setAttribute(IApiXmlConstants.ATTR_VERSION, component.getVersion()); comp.setAttribute(IApiXmlConstants.SKIPPED_DETAILS, component.getErrorDetails()); root.appendChild(comp);
/** * @return the formatted details of why the component was skipped */ public String getErrorDetails() { if (this.errors != null) { StringBuilder buffer = new StringBuilder(); String[] problems = resolveRootErrors(this.errors); for (String problem : problems) { buffer.append(problem).append("<br/>"); //$NON-NLS-1$ } return buffer.toString(); } return SearchMessages.SkippedComponent_component_was_excluded; } }
/** * Returns if we should add the given component to our search scope * * @param component * @param pattern * @param allowresolve * @return * @throws CoreException */ boolean acceptComponent(IApiComponent component, Pattern pattern, boolean allowresolve) throws CoreException { if (!allowresolve) { ResolverError[] errors = component.getErrors(); if (errors != null) { this.notsearched.add(new SkippedComponent(component.getSymbolicName(), component.getVersion(), errors)); return false; } } if (component.isSystemComponent()) { return false; } if (pattern != null) { return pattern.matcher(component.getSymbolicName()).matches(); } return true; }
/** * Returns if we should add the given component to our search scope * @param component * @param pattern * @param allowresolve * @return * @throws CoreException */ boolean acceptComponent(IApiComponent component, Pattern pattern, boolean allowresolve) throws CoreException { if(!allowresolve) { ResolverError[] errors = component.getErrors(); if(errors != null) { this.notsearched.add(new SkippedComponent(component.getSymbolicName(), component.getVersion(), errors)); return false; } } if(component.isSystemComponent()) { return false; } if(pattern != null) { return pattern.matcher(component.getSymbolicName()).matches(); } return true; }
} else { localmonitor.subTask(NLS.bind(Messages.ApiUseScanJob_skipping_component, component.getSymbolicName())); this.notsearched.add(new SkippedComponent(component.getSymbolicName(), component.getVersion(), null));
this.notsearched.add(new SkippedComponent(component.getSymbolicName(), component.getVersion(), null));