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

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

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

XWPFDocument.getHeaderList介绍

暂无

代码示例

代码示例来源:origin: Sayi/poi-tl

@Override
public List<ElementTemplate> visitDocument(XWPFDocument doc) {
  if (null == doc)
    return null;
  this.eleTemplates = new ArrayList<ElementTemplate>();
  visitParagraphs(doc.getParagraphs());
  visitTables(doc.getTables());
  visitHeaders(doc.getHeaderList());
  visitFooters(doc.getFooterList());
  return eleTemplates;
}

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

/**
 * Returns the {@link XWPFHeader} of the given header reference.
 * 
 * @param headerref the header reference.
 * @return
 * @throws XmlException
 * @throws IOException
 */
protected XWPFHeader getXWPFHeader( CTHdrFtrRef headerRef )
  throws XmlException, IOException
{
  PackagePart hdrPart = document.getPartById( headerRef.getId() );
  List<XWPFHeader> headers = document.getHeaderList();
  for ( XWPFHeader header : headers )
  {
    if ( header.getPackagePart().equals( hdrPart ) )
    {
      // header is aleady loaded, return it.
      return header;
    }
  }
  // should never come, but load the header if needed.
  HdrDocument hdrDoc = HdrDocument.Factory.parse( hdrPart.getInputStream() );
  CTHdrFtr hdrFtr = hdrDoc.getHdr();
  XWPFHeader hdr = new XWPFHeader( document, hdrFtr );
  return hdr;
}

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

List<XWPFHeader> headers = doc.getHeaderList();
for (XWPFHeader header : headers) {
  sdts.addAll(extractSDTsFromBodyElements(header.getBodyElements()));

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

/**
 * Returns the {@link XWPFHeader} of the given header reference.
 * 
 * @param headerref the header reference.
 * @return
 * @throws XmlException
 * @throws IOException
 */
protected XWPFHeader getXWPFHeader( CTHdrFtrRef headerRef )
  throws XmlException, IOException
{
  PackagePart hdrPart = document.getPartById( headerRef.getId() );
  List<XWPFHeader> headers = document.getHeaderList();
  for ( XWPFHeader header : headers )
  {
    if ( header.getPackagePart().equals( hdrPart ) )
    {
      // header is aleady loaded, return it.
      return header;
    }
  }
  // should never come, but load the header if needed.
  HdrDocument hdrDoc = HdrDocument.Factory.parse( hdrPart.getInputStream() );
  CTHdrFtr hdrFtr = hdrDoc.getHdr();
  XWPFHeader hdr = new XWPFHeader( document, hdrFtr );
  return hdr;
}

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

/**
 * Returns the {@link XWPFHeader} of the given header reference.
 * 
 * @param headerref the header reference.
 * @return
 * @throws XmlException
 * @throws IOException
 */
protected XWPFHeader getXWPFHeader( CTHdrFtrRef headerRef )
  throws XmlException, IOException
{
  PackagePart hdrPart = document.getPartById( headerRef.getId() );
  List<XWPFHeader> headers = document.getHeaderList();
  for ( XWPFHeader header : headers )
  {
    if ( header.getPackagePart().equals( hdrPart ) )
    {
      // header is aleady loaded, return it.
      return header;
    }
  }
  // should never come, but load the header if needed.
  HdrDocument hdrDoc = HdrDocument.Factory.parse( hdrPart.getInputStream() );
  CTHdrFtr hdrFtr = hdrDoc.getHdr();
  XWPFHeader hdr = new XWPFHeader( document, hdrFtr );
  return hdr;
}

相关文章

XWPFDocument类方法