Example usage for org.apache.poi.xwpf.usermodel XWPFNumbering XWPFNumbering

List of usage examples for org.apache.poi.xwpf.usermodel XWPFNumbering XWPFNumbering

Introduction

In this page you can find the example usage for org.apache.poi.xwpf.usermodel XWPFNumbering XWPFNumbering.

Prototype

public XWPFNumbering(PackagePart part) throws IOException, OpenXML4JException 

Source Link

Document

create a new styles object with an existing document

Usage

From source file:org.apache.tika.parser.microsoft.ooxml.xwpf.XWPFEventBasedWordExtractor.java

License:Apache License

private XWPFNumbering loadNumbering(PackagePart packagePart) {
    try {/* w  ww. j  a  v a2s .com*/
        PackageRelationshipCollection numberingParts = packagePart
                .getRelationshipsByType(XWPFRelation.NUMBERING.getRelation());
        if (numberingParts.size() > 0) {
            PackageRelationship numberingRelationShip = numberingParts.getRelationship(0);
            if (numberingRelationShip == null) {
                return null;
            }
            PackagePart numberingPart = container.getPart(numberingRelationShip);
            if (numberingPart == null) {
                return null;
            }
            return new XWPFNumbering(numberingPart);
        }
    } catch (IOException | OpenXML4JException e) {
        //swallow
    }
    return null;
}