if (srcContribution.getId().equals(array[i].getId())) { isAlreadyIncluded = true;
Toc toc = (Toc)ordered[i].getToc(); orderedTocs.add(toc); tocsById.put(ordered[i].getId(), toc);
contribution.setContributorId(contrib[j].getContributorId()); contribution.setExtraDocuments(contrib[j].getExtraDocuments()); contribution.setId(contrib[j].getId()); contribution.setLocale(contrib[j].getLocale()); contribution.setPrimary(contrib[j].isPrimary()); t.setLinkTo(contrib[j].getLinkTo()); contribution.setToc(t); if(!contributions.containsKey(contrib[j].getId())) contributions.put(contrib[j].getId(), contribution);
private void process(ITocContribution contribution) { if (processedContributions == null) { processedContributions = new HashSet<>(); } // don't process the same one twice if (!processedContributions.contains(contribution)) { if (processor == null) { processor = new DocumentProcessor(); } if (handlers == null) { DocumentReader reader = new DocumentReader(); handlers = new ProcessorHandler[] { new NormalizeHandler(), new LinkHandler(), new AnchorHandler(), new IncludeHandler(reader, contribution.getLocale()), new ExtensionHandler(reader, contribution.getLocale()), }; } processor.setHandlers(handlers); processor.process((Toc)contribution.getToc(), contribution.getId()); processedContributions.add(contribution); } }