public String getFormattedNumber(final Paragraph paragraph) {
        if (paragraph == null) {
            throw new IllegalArgumentException("Given paragraph cannot be null.");
        }
        if (!paragraph.isInList()) {
            throw new IllegalArgumentException("Can only process list paragraphs.");
        }
        //lsid is equivalent to docx's abnum
        //ilfo is equivalent to docx's num
        int currAbNumId = -1;
        try {
            currAbNumId = paragraph.getList().getLsid();
        } catch (NoSuchElementException e) {
            //somewhat frequent exception when initializing HWPFList
            return "";
        } catch (IllegalArgumentException | NullPointerException e) {
            return "";
        }

        int currNumId = paragraph.getIlfo();
        ParagraphLevelCounter lc = listLevelMap.get(currAbNumId);
        LevelTuple[] overrideTuples = overrideTupleMap.get(currNumId);

        if (lc == null) {
            ListData listData = listTables.getListData(paragraph.getList().getLsid());
            if (listData == null) {
                //silently skip
                return "";
            }
            LevelTuple[] levelTuples = new LevelTuple[listData.getLevels().length];
            for (int i = 0; i < listData.getLevels().length; i++) {
                levelTuples[i] = buildTuple(i, listData.getLevels()[i]);
            }
            lc = new ParagraphLevelCounter(levelTuples);
        }
        if (overrideTuples == null) {
            overrideTuples = buildOverrideTuples(paragraph, lc.getNumberOfLevels());
        }
        String formattedString = lc.incrementLevel(paragraph.getIlvl(), overrideTuples);

        listLevelMap.put(currAbNumId, lc);
        overrideTupleMap.put(currNumId, overrideTuples);
        return formattedString;
    }
Get the formatted number for a given paragraph
<p/>
<p><em>Note:</em> This only works correctly if called subsequently for <em>all</em>
paragraphs in a valid selection (main document, text field, ...) which are part of a list
.</p>

@param paragraph list paragraph to process
@return String which represents the numbering of this list paragraph; never {@code null},
can be empty string, though,
if something goes wrong in getList()
@throws IllegalArgumentException If the given paragraph is {@code null} or is not part of
a list
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-microsoft-module/src/main/java/org/apache/tika/parser/microsoft/ListManager.java