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

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

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

XWPFDocument.getRelationIndex介绍

[英]Gets the index of the relation we're trying to create
[中]获取我们试图创建的关系的索引

代码示例

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

/**
 * Creates an empty styles for the document if one does not already exist
 *
 * @return styles
 */
public XWPFStyles createStyles() {
  if (styles == null) {
    StylesDocument stylesDoc = StylesDocument.Factory.newInstance();
    XWPFRelation relation = XWPFRelation.STYLES;
    int i = getRelationIndex(relation);
    XWPFStyles wrapper = (XWPFStyles) createRelationship(relation, XWPFFactory.getInstance(), i);
    wrapper.setStyles(stylesDoc.addNewStyles());
    styles = wrapper;
  }
  return styles;
}

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

/**
 * Creates an empty numbering if one does not already exist and sets the numbering member
 *
 * @return numbering
 */
public XWPFNumbering createNumbering() {
  if (numbering == null) {
    NumberingDocument numberingDoc = NumberingDocument.Factory.newInstance();
    XWPFRelation relation = XWPFRelation.NUMBERING;
    int i = getRelationIndex(relation);
    XWPFNumbering wrapper = (XWPFNumbering) createRelationship(relation, XWPFFactory.getInstance(), i);
    wrapper.setNumbering(numberingDoc.addNewNumbering());
    numbering = wrapper;
  }
  return numbering;
}

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

public XWPFEndnotes createEndnotes() {
  if (endnotes == null) {
    EndnotesDocument endnotesDoc = EndnotesDocument.Factory.newInstance();
    XWPFRelation relation = XWPFRelation.ENDNOTE;
    int i = getRelationIndex(relation);
    XWPFEndnotes wrapper = (XWPFEndnotes) createRelationship(relation, XWPFFactory.getInstance(), i);
    wrapper.setEndnotes(endnotesDoc.addNewEndnotes());
    wrapper.setIdManager(footnoteIdManager);
    endnotes = wrapper;
  }
  return endnotes;
  
}

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

/**
 * Creates an empty footnotes element for the document if one does not already exist
 *
 * @return footnotes
 */
public XWPFFootnotes createFootnotes() {
  if (footnotes == null) {
    FootnotesDocument footnotesDoc = FootnotesDocument.Factory.newInstance();
    XWPFRelation relation = XWPFRelation.FOOTNOTE;
    int i = getRelationIndex(relation);
    XWPFFootnotes wrapper = (XWPFFootnotes) createRelationship(relation, XWPFFactory.getInstance(), i);
    wrapper.setFootnotes(footnotesDoc.addNewFootnotes());
    wrapper.setIdManager(this.footnoteIdManager);
    footnotes = wrapper;
  }
  return footnotes;
}

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

/**
 * Creates an empty footnotes element for the document if one does not already exist
 * @return footnotes
 */
public XWPFFootnotes createFootnotes() {
  if(footnotes == null) {
   FootnotesDocument footnotesDoc = FootnotesDocument.Factory.newInstance();
   XWPFRelation relation = XWPFRelation.FOOTNOTE;
   int i = getRelationIndex(relation);
   XWPFFootnotes wrapper = (XWPFFootnotes)createRelationship(relation, XWPFFactory.getInstance(), i);
   wrapper.setFootnotes(footnotesDoc.addNewFootnotes());
   footnotes = wrapper;
  }
  return footnotes;
}

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

/**
 * Creates an empty numbering if one does not already exist and sets the numbering member
 * @return numbering
 */
public XWPFNumbering createNumbering() {
  if(numbering == null) {
    NumberingDocument numberingDoc = NumberingDocument.Factory.newInstance();
    XWPFRelation relation = XWPFRelation.NUMBERING;
    int i = getRelationIndex(relation);
    XWPFNumbering wrapper = (XWPFNumbering)createRelationship(relation, XWPFFactory.getInstance(), i);
    wrapper.setNumbering(numberingDoc.addNewNumbering());
    numbering = wrapper;
  }
  return numbering;
}

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

/**
 * Creates an empty numbering if one does not already exist and sets the numbering member
 *
 * @return numbering
 */
public XWPFNumbering createNumbering() {
  if (numbering == null) {
    NumberingDocument numberingDoc = NumberingDocument.Factory.newInstance();
    XWPFRelation relation = XWPFRelation.NUMBERING;
    int i = getRelationIndex(relation);
    XWPFNumbering wrapper = (XWPFNumbering) createRelationship(relation, XWPFFactory.getInstance(), i);
    wrapper.setNumbering(numberingDoc.addNewNumbering());
    numbering = wrapper;
  }
  return numbering;
}

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

/**
 * Creates an empty styles for the document if one does not already exist
 *
 * @return styles
 */
public XWPFStyles createStyles() {
  if (styles == null) {
    StylesDocument stylesDoc = StylesDocument.Factory.newInstance();
    XWPFRelation relation = XWPFRelation.STYLES;
    int i = getRelationIndex(relation);
    XWPFStyles wrapper = (XWPFStyles) createRelationship(relation, XWPFFactory.getInstance(), i);
    wrapper.setStyles(stylesDoc.addNewStyles());
    styles = wrapper;
  }
  return styles;
}

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

/**
 * Creates an empty styles for the document if one does not already exist
 * @return styles
 */
public XWPFStyles createStyles() {
  if(styles == null) {
   StylesDocument stylesDoc = StylesDocument.Factory.newInstance();
   XWPFRelation relation = XWPFRelation.STYLES;
   int i = getRelationIndex(relation);
   XWPFStyles wrapper = (XWPFStyles)createRelationship(relation, XWPFFactory.getInstance(), i);
   wrapper.setStyles(stylesDoc.addNewStyles());
   styles = wrapper;
  }
  return styles;
}

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

public XWPFEndnotes createEndnotes() {
  if (endnotes == null) {
    EndnotesDocument endnotesDoc = EndnotesDocument.Factory.newInstance();
    XWPFRelation relation = XWPFRelation.ENDNOTE;
    int i = getRelationIndex(relation);
    XWPFEndnotes wrapper = (XWPFEndnotes) createRelationship(relation, XWPFFactory.getInstance(), i);
    wrapper.setEndnotes(endnotesDoc.addNewEndnotes());
    wrapper.setIdManager(footnoteIdManager);
    endnotes = wrapper;
  }
  return endnotes;
  
}

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

/**
 * Creates an empty footnotes element for the document if one does not already exist
 *
 * @return footnotes
 */
public XWPFFootnotes createFootnotes() {
  if (footnotes == null) {
    FootnotesDocument footnotesDoc = FootnotesDocument.Factory.newInstance();
    XWPFRelation relation = XWPFRelation.FOOTNOTE;
    int i = getRelationIndex(relation);
    XWPFFootnotes wrapper = (XWPFFootnotes) createRelationship(relation, XWPFFactory.getInstance(), i);
    wrapper.setFootnotes(footnotesDoc.addNewFootnotes());
    wrapper.setIdManager(this.footnoteIdManager);
    footnotes = wrapper;
  }
  return footnotes;
}

相关文章

XWPFDocument类方法