org.apache.poi.xwpf.usermodel.XWPFDocument.getNumbering()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(211)

本文整理了Java中org.apache.poi.xwpf.usermodel.XWPFDocument.getNumbering()方法的一些代码示例,展示了XWPFDocument.getNumbering()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XWPFDocument.getNumbering()方法的具体详情如下:
包路径:org.apache.poi.xwpf.usermodel.XWPFDocument
类名称:XWPFDocument
方法名:getNumbering

XWPFDocument.getNumbering介绍

[英]getNumbering
[中]获取编号

代码示例

代码示例来源:origin: org.apache.poi/poi-ooxml

XWPFNumbering numbering = document.getNumbering();
if (numID != null && numbering != null) {
  XWPFNum num = numbering.getNum(numID);

代码示例来源:origin: org.apache.poi/poi-ooxml

/**
 * Returns numbering format for this paragraph, eg bullet or
 * lowerLetter.
 * Returns null if this paragraph does not have numeric style.
 */
public String getNumFmt() {
  BigInteger numID = getNumID();
  XWPFNumbering numbering = document.getNumbering();
  if (numID != null && numbering != null) {
    XWPFNum num = numbering.getNum(numID);
    if (num != null) {
      BigInteger ilvl = getNumIlvl();
      BigInteger abstractNumId = num.getCTNum().getAbstractNumId().getVal();
      CTAbstractNum anum = numbering.getAbstractNum(abstractNumId).getAbstractNum();
      CTLvl level = null;
      for (int i = 0; i < anum.sizeOfLvlArray(); i++) {
        CTLvl lvl = anum.getLvlArray(i);
        if (lvl.getIlvl().equals(ilvl)) {
          level = lvl;
          break;
        }
      }
      if (level != null && level.getNumFmt() != null
          && level.getNumFmt().getVal() != null) {
        return level.getNumFmt().getVal().toString();
      }
    }
  }
  return null;
}

代码示例来源:origin: org.apache.poi/poi-ooxml

XWPFNumbering numbering = document.getNumbering();
if (numID != null && numbering != null) {
  XWPFNum num = numbering.getNum(numID);

代码示例来源:origin: apache/tika

throws SAXException, XmlException, IOException {
XWPFHeaderFooterPolicy hfPolicy = document.getHeaderFooterPolicy();
XWPFListManager listManager = new XWPFListManager(document.getNumbering());

代码示例来源:origin: stackoverflow.com

XWPFNumbering numbering = doc.getNumbering();
return doc.getNumbering().addNum(id);

代码示例来源:origin: com.github.livesense/org.liveSense.framework.xdocreport

protected XWPFNum getXWPFNum( CTNumPr numPr )
{
  CTDecimalNumber numID = numPr.getNumId();
  if ( numID == null )
  {
    // numID can be null, ignore the numbering
    // see https://code.google.com/p/xdocreport/issues/detail?id=239
    return null;
  }
  XWPFNum num = document.getNumbering().getNum( numID.getVal() );
  return num;
}

代码示例来源:origin: stackoverflow.com

return doc.getNumbering().addNum(id);

代码示例来源:origin: fr.opensagres.xdocreport/org.apache.poi.xwpf.converter.core-gae

protected XWPFNum getXWPFNum( CTNumPr numPr )
{
  CTDecimalNumber numID = numPr.getNumId();
  if ( numID == null )
  {
    // numID can be null, ignore the numbering
    // see https://code.google.com/p/xdocreport/issues/detail?id=239
    return null;
  }
  XWPFNum num = document.getNumbering().getNum( numID.getVal() );
  return num;
}

代码示例来源:origin: fr.opensagres.xdocreport/org.apache.poi.xwpf.converter.core

protected XWPFNum getXWPFNum( CTNumPr numPr )
{
  CTDecimalNumber numID = numPr.getNumId();
  if ( numID == null )
  {
    // numID can be null, ignore the numbering
    // see https://code.google.com/p/xdocreport/issues/detail?id=239
    return null;
  }
  XWPFNum num = document.getNumbering().getNum( numID.getVal() );
  return num;
}

代码示例来源:origin: fr.opensagres.xdocreport/org.apache.poi.xwpf.converter.core-gae

protected XWPFAbstractNum getXWPFAbstractNum( XWPFNum num )
{
  CTDecimalNumber abstractNumID = num.getCTNum().getAbstractNumId();
  XWPFAbstractNum abstractNum = document.getNumbering().getAbstractNum( abstractNumID.getVal() );
  return abstractNum;
}

代码示例来源:origin: fr.opensagres.xdocreport/org.apache.poi.xwpf.converter.core

protected XWPFAbstractNum getXWPFAbstractNum( XWPFNum num )
{
  CTDecimalNumber abstractNumID = num.getCTNum().getAbstractNumId();
  XWPFAbstractNum abstractNum = document.getNumbering().getAbstractNum( abstractNumID.getVal() );
  return abstractNum;
}

代码示例来源:origin: com.github.livesense/org.liveSense.framework.xdocreport

protected XWPFAbstractNum getXWPFAbstractNum( XWPFNum num )
{
  CTDecimalNumber abstractNumID = num.getCTNum().getAbstractNumId();
  XWPFAbstractNum abstractNum = document.getNumbering().getAbstractNum( abstractNumID.getVal() );
  return abstractNum;
}

代码示例来源:origin: com.github.lafa.tikaNoExternal/tika-parsers

/**
 * @see org.apache.poi.xwpf.extractor.XWPFWordExtractor#getText()
 */
@Override
protected void buildXHTML(XHTMLContentHandler xhtml)
    throws SAXException, XmlException, IOException {
  XWPFHeaderFooterPolicy hfPolicy = document.getHeaderFooterPolicy();
  XWPFListManager listManager = new XWPFListManager(document.getNumbering());
  // headers
  if (hfPolicy != null) {
    extractHeaders(xhtml, hfPolicy, listManager);
  }
  // process text in the order that it occurs in
  extractIBodyText(document, listManager, xhtml);
  // then all document tables
  if (hfPolicy != null) {
    extractFooters(xhtml, hfPolicy, listManager);
  }
}

代码示例来源:origin: stackoverflow.com

XWPFNumbering numberingDocx1 = docx1.getNumbering();

代码示例来源:origin: org.apache.tika/tika-parsers

throws SAXException, XmlException, IOException {
XWPFHeaderFooterPolicy hfPolicy = document.getHeaderFooterPolicy();
XWPFListManager listManager = new XWPFListManager(document.getNumbering());

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

XWPFNumbering numbering = document.getNumbering();
if (numID != null && numbering != null) {
  XWPFNum num = numbering.getNum(numID);

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

/**
 * Returns numbering format for this paragraph, eg bullet or
 * lowerLetter.
 * Returns null if this paragraph does not have numeric style.
 */
public String getNumFmt() {
  BigInteger numID = getNumID();
  XWPFNumbering numbering = document.getNumbering();
  if (numID != null && numbering != null) {
    XWPFNum num = numbering.getNum(numID);
    if (num != null) {
      BigInteger ilvl = getNumIlvl();
      BigInteger abstractNumId = num.getCTNum().getAbstractNumId().getVal();
      CTAbstractNum anum = numbering.getAbstractNum(abstractNumId).getAbstractNum();
      CTLvl level = null;
      for (int i = 0; i < anum.sizeOfLvlArray(); i++) {
        CTLvl lvl = anum.getLvlArray(i);
        if (lvl.getIlvl().equals(ilvl)) {
          level = lvl;
          break;
        }
      }
      if (level != null && level.getNumFmt() != null
          && level.getNumFmt().getVal() != null) {
        return level.getNumFmt().getVal().toString();
      }
    }
  }
  return null;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

XWPFNumbering numbering = document.getNumbering();
if (numID != null && numbering != null) {
  XWPFNum num = numbering.getNum(numID);

相关文章

XWPFDocument类方法