|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.poi.POIXMLDocumentPart
org.apache.poi.POIXMLDocument
org.apache.poi.xwpf.usermodel.XWPFDocument
public class XWPFDocument
Experimental class to do low level processing of docx files. If you are using these low level classes, then you will almost certainly need to refer to the OOXML specifications from http://www.ecma-international.org/publications/standards/Ecma-376.htm WARNING - APIs expected to change rapidly
Field Summary | |
---|---|
protected java.util.List<XWPFComment> |
comments
|
protected java.util.Map<java.lang.Integer,XWPFFootnote> |
endnotes
|
protected java.util.Map<java.lang.Integer,XWPFFootnote> |
footnotes
|
protected java.util.List<XWPFHyperlink> |
hyperlinks
|
protected java.util.List<XWPFParagraph> |
paragraphs
|
protected java.util.List<XWPFTable> |
tables
|
Fields inherited from class org.apache.poi.POIXMLDocument |
---|
CORE_PROPERTIES_REL_TYPE, CUSTOM_PROPERTIES_REL_TYPE, DOCUMENT_CREATOR, EXTENDED_PROPERTIES_REL_TYPE, OLE_OBJECT_REL_TYPE, PACK_OBJECT_REL_TYPE |
Fields inherited from class org.apache.poi.POIXMLDocumentPart |
---|
DEFAULT_XML_OPTIONS |
Constructor Summary | |
---|---|
XWPFDocument()
|
|
XWPFDocument(java.io.InputStream is)
|
|
XWPFDocument(OPCPackage pkg)
|
Method Summary | |
---|---|
protected void |
commit()
Save the content in the underlying package part. |
XWPFParagraph |
createParagraph()
Appends a new paragraph to this document |
XWPFTable |
createTable()
Create an empty table with one row and one column as default. |
XWPFTable |
createTable(int rows,
int cols)
Create an empty table with a number of rows and cols specified |
java.util.List<PackagePart> |
getAllEmbedds()
Get the document's embedded files. |
XWPFComment |
getCommentByID(java.lang.String id)
|
XWPFComment[] |
getComments()
|
org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDocument1 |
getDocument()
Returns the low level document base object |
XWPFFootnote |
getEndnoteByID(int id)
|
XWPFFootnote |
getFootnoteByID(int id)
|
java.util.Collection<XWPFFootnote> |
getFootnotes()
|
XWPFHeaderFooterPolicy |
getHeaderFooterPolicy()
Returns the policy on headers and footers, which also provides a way to get at them. |
XWPFHyperlink |
getHyperlinkByID(java.lang.String id)
|
XWPFHyperlink[] |
getHyperlinks()
|
XWPFParagraph[] |
getParagraphs()
|
java.util.Iterator<XWPFParagraph> |
getParagraphsIterator()
|
PackagePart |
getPartById(java.lang.String id)
Get the document part that's defined as the given relationship of the core document. |
org.openxmlformats.schemas.wordprocessingml.x2006.main.CTStyles |
getStyle()
Returns the styles object used |
java.util.Iterator<XWPFTable> |
getTablesIterator()
|
protected static OPCPackage |
newPackage()
Create a new SpreadsheetML package and setup the default minimal content |
protected void |
onDocumentCreate()
Create a new CTWorkbook with all values set to default |
protected void |
onDocumentRead()
Fired when a package part is read |
Methods inherited from class org.apache.poi.POIXMLDocument |
---|
ensureWriteAccess, getCorePart, getPackage, getProperties, getRelatedByType, getTargetPart, getTargetPart, hasOOXMLHeader, load, openPackage, write |
Methods inherited from class org.apache.poi.POIXMLDocumentPart |
---|
addRelation, createRelationship, createRelationship, createRelationship, getPackagePart, getPackageRelationship, getParent, getRelations, onSave, read, removeRelation, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.List<XWPFComment> comments
protected java.util.List<XWPFHyperlink> hyperlinks
protected java.util.List<XWPFParagraph> paragraphs
protected java.util.List<XWPFTable> tables
protected java.util.Map<java.lang.Integer,XWPFFootnote> footnotes
protected java.util.Map<java.lang.Integer,XWPFFootnote> endnotes
Constructor Detail |
---|
public XWPFDocument(OPCPackage pkg) throws java.io.IOException
java.io.IOException
public XWPFDocument(java.io.InputStream is) throws java.io.IOException
java.io.IOException
public XWPFDocument()
Method Detail |
---|
protected void onDocumentRead() throws java.io.IOException
POIXMLDocumentPart
onDocumentRead
in class POIXMLDocumentPart
java.io.IOException
protected static OPCPackage newPackage()
protected void onDocumentCreate()
onDocumentCreate
in class POIXMLDocumentPart
public org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDocument1 getDocument()
public java.util.Iterator<XWPFParagraph> getParagraphsIterator()
public XWPFParagraph[] getParagraphs()
public java.util.Iterator<XWPFTable> getTablesIterator()
public XWPFHyperlink getHyperlinkByID(java.lang.String id)
public XWPFFootnote getFootnoteByID(int id)
public XWPFFootnote getEndnoteByID(int id)
public java.util.Collection<XWPFFootnote> getFootnotes()
public XWPFHyperlink[] getHyperlinks()
public XWPFComment getCommentByID(java.lang.String id)
public XWPFComment[] getComments()
public PackagePart getPartById(java.lang.String id)
public XWPFHeaderFooterPolicy getHeaderFooterPolicy()
public org.openxmlformats.schemas.wordprocessingml.x2006.main.CTStyles getStyle() throws org.apache.xmlbeans.XmlException, java.io.IOException
org.apache.xmlbeans.XmlException
java.io.IOException
public java.util.List<PackagePart> getAllEmbedds() throws OpenXML4JException
getAllEmbedds
in class POIXMLDocument
OpenXML4JException
protected void commit() throws java.io.IOException
POIXMLDocumentPart
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();
}
commit
in class POIXMLDocumentPart
java.io.IOException
public XWPFParagraph createParagraph()
public XWPFTable createTable()
public XWPFTable createTable(int rows, int cols)
rows
- cols
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |