Package io.keikai.doc.io.schema.docx
Class DOCXDocument
- java.lang.Object
-
- io.keikai.doc.io.schema.docx.AbstractVisitable
-
- io.keikai.doc.io.schema.docx.AbstractBody
-
- io.keikai.doc.io.schema.docx.DOCXDocument
-
- All Implemented Interfaces:
ICTElement,IDOCXVisitable<java.lang.Object>,IXWPFElement
public class DOCXDocument extends AbstractBody
Internal Use Only.Document Definition.
Represents
w:documentin xml.- Author:
- Jamson Chan
-
-
Field Summary
-
Fields inherited from class io.keikai.doc.io.schema.docx.AbstractBody
_bodyElements
-
-
Constructor Summary
Constructors Constructor Description DOCXDocument(org.apache.poi.xwpf.usermodel.XWPFDocument xwpfDocument)Create a new Document by given XWPFDocument.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectaccept(IDOCXVisitor visitor)Accepts a visitor.DOCXPcreateParagraph()Create a new Paragraph.DOCXTblcreateTable()Create a new Table.org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDocument1getCT()Returns the CT object of current element.DOCXFtrgetFooterById(java.lang.String id)Returns theDOCXFtrby the given id.DOCXHdrgetHeaderById(java.lang.String id)Returns theDOCXHdrby the given id.IXWPFElementgetParent()Returns the parent element of current element.DOCXSectPrgetSectPr()Returns theDOCXSectProf this document (equals to the last section of the whole docx file).DOCXSectPrgetSectPr(boolean create)Returns theDOCXSectProf this document (equals to the last section of the whole docx file).DOCXSettingsgetSettings()Returns the settings of this document.org.apache.poi.xwpf.usermodel.XWPFDocumentgetXWPF()Returns the XWPF object of current element.voidwrite(java.io.OutputStream os)Write the document to the given file output stream.-
Methods inherited from class io.keikai.doc.io.schema.docx.AbstractBody
getBodyElements
-
Methods inherited from class io.keikai.doc.io.schema.docx.AbstractVisitable
addTempData, getTempData
-
-
-
-
Method Detail
-
getCT
public org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDocument1 getCT()
Description copied from interface:ICTElementReturns the CT object of current element.
-
accept
public java.lang.Object accept(IDOCXVisitor visitor)
Description copied from interface:IDOCXVisitableAccepts a visitor.
-
getXWPF
public org.apache.poi.xwpf.usermodel.XWPFDocument getXWPF()
Description copied from interface:IXWPFElementReturns the XWPF object of current element.- Specified by:
getXWPFin interfaceIXWPFElement- Overrides:
getXWPFin classAbstractBody
-
getParent
public IXWPFElement getParent()
Description copied from interface:IXWPFElementReturns the parent element of current element.
-
write
public void write(java.io.OutputStream os) throws java.io.IOExceptionWrite the document to the given file output stream.- Parameters:
os- theOutputStream.- Throws:
java.io.IOException- if an I/O error occurs.
-
getSettings
public DOCXSettings getSettings()
Returns the settings of this document.Represents the xml file at
word/settings.xml.- Returns:
- the
DOCXSettingsobject.
-
createParagraph
public DOCXP createParagraph()
Description copied from class:AbstractBodyCreate a new Paragraph.- Specified by:
createParagraphin classAbstractBody- Returns:
- the new Paragraph.
-
createTable
public DOCXTbl createTable()
Description copied from class:AbstractBodyCreate a new Table.- Specified by:
createTablein classAbstractBody- Returns:
- the new Table.
-
getSectPr
public DOCXSectPr getSectPr()
Returns theDOCXSectProf this document (equals to the last section of the whole docx file).- Returns:
- the
DOCXSectProbject.
-
getSectPr
public DOCXSectPr getSectPr(boolean create)
Returns theDOCXSectProf this document (equals to the last section of the whole docx file).Represents the following element tag in the schema:
w:sectPr.- Parameters:
create- whether to create a new section properties if not exist.- Returns:
- the
DOCXSectProbject.
-
getHeaderById
public DOCXHdr getHeaderById(java.lang.String id)
Returns theDOCXHdrby the given id.- Parameters:
id- the header id.- Returns:
- the
DOCXHdrobject.
-
-