use of org.openxmlformats.schemas.wordprocessingml.x2006.main.NumberingDocument in project poi by apache.
the class XWPFNumbering method onDocumentRead.
/**
* read numbering form an existing package
*/
@Override
protected void onDocumentRead() throws IOException {
NumberingDocument numberingDoc = null;
InputStream is;
is = getPackagePart().getInputStream();
try {
numberingDoc = NumberingDocument.Factory.parse(is, DEFAULT_XML_OPTIONS);
ctNumbering = numberingDoc.getNumbering();
//get any Nums
for (CTNum ctNum : ctNumbering.getNumArray()) {
nums.add(new XWPFNum(ctNum, this));
}
for (CTAbstractNum ctAbstractNum : ctNumbering.getAbstractNumArray()) {
abstractNums.add(new XWPFAbstractNum(ctAbstractNum, this));
}
isNew = false;
} catch (XmlException e) {
throw new POIXMLException();
} finally {
is.close();
}
}
Aggregations