List of usage examples for org.apache.poi.xwpf.usermodel XWPFFootnotes getFootnoteById
public XWPFAbstractFootnoteEndnote getFootnoteById(int id)
From source file:de.knowwe.include.export.FootnoteExporter.java
License:Open Source License
private BigInteger getFootnoteIDInternal(DocumentBuilder builder, Article article, String footnoteNumber) { Pair<Article, String> key = new Pair<>(article, footnoteNumber.trim()); BigInteger id = footnoteIDs.get(key); if (id == null) { XWPFFootnotes footnotes = builder.getDocument().createFootnotes(); // check until the footnote does not exists yet lastFootnoteID++;//from w w w .ja v a 2 s. c o m while (footnotes.getFootnoteById(lastFootnoteID) != null) { lastFootnoteID++; } id = BigInteger.valueOf(lastFootnoteID); footnoteIDs.put(key, id); } return id; }