Iterate through the paragraphs comprising the list and for each p, get its pPr. Then, something like:
Using java Syntax Highlighting
if ( pPr
!=null ) {
String pStyleVal
=null;
// Set @class
if (pPr.
getPStyle()!=null
&& pPr.
getPStyle().
getVal()!=null) {
pStyleVal
= pPr.
getPStyle().
getVal();
}
// Numbering
String numberText
=null;
String numId
=null;
String levelId
=null;
if (pPr.
getNumPr()!=null) {
numId
= pPr.
getNumPr().
getNumId()==null ? null : pPr.
getNumPr().
getNumId().
getVal().
toString();
levelId
= pPr.
getNumPr().
getIlvl()==null ? null : pPr.
getNumPr().
getIlvl().
getVal().
toString();
}
ResultTriple triple
= org.
docx4j.
model.
listnumbering.
Emulator.
getNumber(
wordMLPackage, pStyleVal, numId, levelId
);
if (triple
==null) {
log.
debug("computed number ResultTriple was null");
} else {
if (triple.
getBullet() != null) {
numberText
= (triple.
getBullet() + " ");
} else if (triple.
getNumString() == null) {
log.
error("computed NumString was null!");
numberText
= ("?");
} else {
numberText
= (triple.
getNumString() + " ");
}
}
if (numberText
!=null) {
// Do whatever
}
}
Parsed in 0.017 seconds, using
GeSHi 1.0.8.4