org.apache.poi.xwpf.usermodel
Class XWPFFootnotes

java.lang.Object
  extended by org.apache.poi.POIXMLDocumentPart
      extended by org.apache.poi.xwpf.usermodel.XWPFFootnotes

public class XWPFFootnotes
extends POIXMLDocumentPart

Looks after the collection of Footnotes for a document


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.poi.POIXMLDocumentPart
POIXMLDocumentPart.RelationPart
 
Field Summary
protected  XWPFDocument document
           
 
Constructor Summary
XWPFFootnotes()
          Construct XWPFFootnotes from scratch for a new document.
XWPFFootnotes(PackagePart part)
          Construct XWPFFootnotes from a package part
 
Method Summary
 XWPFFootnote addFootnote(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn note)
          add a footnote to the document
 void addFootnote(XWPFFootnote footnote)
          add an XWPFFootnote to the document
protected  void commit()
          Save the content in the underlying package part.
 XWPFFootnote getFootnoteById(int id)
           
 java.util.List<XWPFFootnote> getFootnotesList()
           
 XWPFDocument getXWPFDocument()
           
protected  void onDocumentRead()
          Read document
 void setFootnotes(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFootnotes footnotes)
          Sets the ctFootnotes
 void setXWPFDocument(XWPFDocument doc)
           
 
Methods inherited from class org.apache.poi.POIXMLDocumentPart
_invokeOnDocumentRead, addRelation, createRelationship, createRelationship, createRelationship, getNextPartNumber, getPackagePart, getParent, getRelationById, getRelationId, getRelationParts, getRelations, getTargetPart, onDocumentCreate, onDocumentRemove, onSave, prepareForCommit, read, rebase, removeRelation, removeRelation, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

document

protected XWPFDocument document
Constructor Detail

XWPFFootnotes

public XWPFFootnotes(PackagePart part)
              throws java.io.IOException,
                     OpenXML4JException
Construct XWPFFootnotes from a package part

Parameters:
part - the package part holding the data of the footnotes,
Throws:
java.io.IOException
OpenXML4JException
Since:
POI 3.14-Beta1

XWPFFootnotes

public XWPFFootnotes()
Construct XWPFFootnotes from scratch for a new document.

Method Detail

onDocumentRead

protected void onDocumentRead()
                       throws java.io.IOException
Read document

Overrides:
onDocumentRead in class POIXMLDocumentPart
Throws:
java.io.IOException - a subclass may throw an IOException when a document is read

commit

protected void commit()
               throws java.io.IOException
Description copied from class: POIXMLDocumentPart
Save the content in the underlying package part. Default implementation is empty meaning that the package part is left unmodified. Sub-classes should override and add logic to marshal the "model" into Ooxml4J. For example, the code saving a generic XML entry may look as follows:
 protected void commit() throws IOException {
   PackagePart part = getPackagePart();
   OutputStream out = part.getOutputStream();
   XmlObject bean = getXmlBean(); //the "model" which holds changes in memory
   bean.save(out, DEFAULT_XML_OPTIONS);
   out.close();
 }
 

Overrides:
commit in class POIXMLDocumentPart
Throws:
java.io.IOException - a subclass may throw an IOException if the changes can't be committed

getFootnotesList

public java.util.List<XWPFFootnote> getFootnotesList()

getFootnoteById

public XWPFFootnote getFootnoteById(int id)

setFootnotes

public void setFootnotes(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFootnotes footnotes)
Sets the ctFootnotes

Parameters:
footnotes -

addFootnote

public void addFootnote(XWPFFootnote footnote)
add an XWPFFootnote to the document

Parameters:
footnote -
Throws:
java.io.IOException

addFootnote

public XWPFFootnote addFootnote(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFtnEdn note)
add a footnote to the document

Parameters:
note -
Throws:
java.io.IOException

getXWPFDocument

public XWPFDocument getXWPFDocument()
See Also:
IBody.getPart()

setXWPFDocument

public void setXWPFDocument(XWPFDocument doc)