private LevelTuple buildTuple(int level, CTLvl ctLvl) {
        boolean isLegal = false;
        int start = 1;
        int restart = -1;
        String lvlText = "%" + level + ".";
        String numFmt = "decimal";


        if (ctLvl != null && ctLvl.getIsLgl() != null) {
            isLegal = true;
        }

        if (ctLvl != null && ctLvl.getNumFmt() != null && ctLvl.getNumFmt().getVal() != null) {
            numFmt = ctLvl.getNumFmt().getVal().toString();
        }
        if (ctLvl != null && ctLvl.getLvlRestart() != null &&
                ctLvl.getLvlRestart().getVal() != null) {
            restart = ctLvl.getLvlRestart().getVal().intValue();
        }
        if (ctLvl != null && ctLvl.getStart() != null && ctLvl.getStart().getVal() != null) {
            start = ctLvl.getStart().getVal().intValue();
        } else {

            //this is a hack. Currently, this gets the lowest possible
            //start for a given numFmt.  We should probably try to grab the
            //restartNumberingAfterBreak value in
            //e.g. <w:abstractNum w:abstractNumId="12" w15:restartNumberingAfterBreak="0">???
            if ("decimal".equals(numFmt) || "ordinal".equals(numFmt) ||
                    "decimalZero".equals(numFmt)) {
                start = 0;
            } else {
                start = 1;
            }
        }
        if (ctLvl != null && ctLvl.getLvlText() != null && ctLvl.getLvlText().getVal() != null) {
            lvlText = ctLvl.getLvlText().getVal();
        }
        return new LevelTuple(start, restart, lvlText, numFmt, isLegal);
    }
@param paragraph paragraph
@return the formatted number or an empty string if something went wrong
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-microsoft-module/src/main/java/org/apache/tika/parser/microsoft/ooxml/XWPFListManager.java