components = sort(components); visitor.visitScan(); SAXParser parser = getParser(); String[] idv = getIdVersion(component.getName()); IComponentDescriptor targetComponent = Factory.componentDescriptor(idv[0], idv[1]); if (visitor.visitComponent(targetComponent)) { File[] xmlfiles = Util.getAllFiles(component, filter); if (xmlfiles != null && xmlfiles.length > 0) { parser.parse(xmlfile, handler); List<IApiProblem> apiProblems = handler.getProblems(); visitor.addToCurrentReport(apiProblems); } catch (SAXException | IOException e) { ApiPlugin.log("Failed to load problems from " + xmlfile, e); //$NON-NLS-1$ visitor.endVisitComponent();
buffer.append(REF_STYLE); buffer.append(REF_SCRIPT); buffer.append(OPEN_TITLE).append(getProblemTitle(report.name)).append(CLOSE_TITLE); buffer.append(CLOSE_HEAD); buffer.append(OPEN_BODY); buffer.append(OPEN_H3).append(getProblemTitle(report.name)).append(CLOSE_H3); buffer.append(getProblemSummary(report)); switch (key.intValue()) { case IApiProblem.API_USE_SCAN_TYPE_PROBLEM: typeProblems.append(getProblemTable(types)); break; case IApiProblem.API_USE_SCAN_METHOD_PROBLEM: methodProblems.append(getProblemTable(types)); break; case IApiProblem.API_USE_SCAN_FIELD_PROBLEM: fieldProblems.append(getProblemTable(types)); break; default: buffer.append(getProblemsTableHeader(SearchMessages.MissingRefReportConverter_ProblemDetails, SearchMessages.MissingRefReportConverter_ProblemTypes)); if (typeProblems.length() > 0) { buffer.append(getProblemRow(typeProblems, SearchMessages.MissingRefReportConverter_Type)); buffer.append(getProblemRow(methodProblems, SearchMessages.MissingRefReportConverter_Method)); buffer.append(getProblemRow(fieldProblems, SearchMessages.MissingRefReportConverter_Field));
/** * Parse the XML directories and report.xml and generate HTML for them */ protected List<?> parse() throws Exception { MissingRefParser lparser = new MissingRefParser(); MissingRefVisitor visitor = new MissingRefVisitor(); lparser.parse(getXmlLocation(), visitor); return visitor.reports; }
public boolean visitComponent(IComponentDescriptor targetComponent) { currentreport = new Report(); currentreport.name = composeName(targetComponent.getId(), targetComponent.getVersion()); reports.add(currentreport); return true; }