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<Object>,IXWPFElement
Internal Use Only.
Document Definition.
Represents w:document in xml.
- Author:
- Jamson Chan
-
Field Summary
Fields inherited from class io.keikai.doc.io.schema.docx.AbstractBody
_bodyElements -
Constructor Summary
ConstructorsConstructorDescriptionDOCXDocument(org.apache.poi.xwpf.usermodel.XWPFDocument xwpfDocument) Create a new Document by given XWPFDocument. -
Method Summary
Modifier and TypeMethodDescriptionaccept(IDOCXVisitor visitor) Accepts a visitor.addNumbering(org.openxmlformats.schemas.wordprocessingml.x2006.main.STNumberFormat.Enum format, String lvlText, BigInteger indent) Adds a new numbering definition to the document, and returns the numbering id of this new numbering.Create a new Paragraph.Create a new Table.org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDocument1getCT()Returns the CT object of current element.getFooterById(String id) Returns theDOCXFtrby the given id.getHeaderById(String id) Returns theDOCXHdrby the given id.org.openxmlformats.schemas.wordprocessingml.x2006.main.CTLvlgetNumbering(BigInteger numId, BigInteger level) Returns the numbering dataCTLvlfor a specific numbering id and level.Returns the parent element of current element.Returns theDOCXSectProf this document (equals to the last section of the whole docx file).getSectPr(boolean create) Returns theDOCXSectProf this document (equals to the last section of the whole docx file).Returns the settings of this document.Returns the styles of this document.org.apache.poi.xwpf.usermodel.XWPFDocumentgetXWPF()Returns the XWPF object of current element.voidResets the previous numbering data.voidwrite(OutputStream os) Write the document to the given file output stream.Methods inherited from class io.keikai.doc.io.schema.docx.AbstractBody
getBodyElementsMethods inherited from class io.keikai.doc.io.schema.docx.AbstractVisitable
addTempData, getTempData
-
Constructor Details
-
DOCXDocument
public DOCXDocument(org.apache.poi.xwpf.usermodel.XWPFDocument xwpfDocument) Create a new Document by given XWPFDocument.- Parameters:
xwpfDocument- the XWPFDocument object.
-
-
Method Details
-
getCT
public org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDocument1 getCT()Description copied from interface:ICTElementReturns the CT object of current element. -
accept
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
Description copied from interface:IXWPFElementReturns the parent element of current element. -
write
Write the document to the given file output stream.- Parameters:
os- theOutputStream.- Throws:
IOException- if an I/O error occurs.
-
getSettings
Returns the settings of this document.Represents the xml file at
word/settings.xml.- Returns:
- the
DOCXSettingsobject.
-
getStyles
Returns the styles of this document.Represents the xml file at
word/styles.xml.- Returns:
- the
DOCXStylesobject.
-
createParagraph
Description copied from class:AbstractBodyCreate a new Paragraph.- Specified by:
createParagraphin classAbstractBody- Returns:
- the new Paragraph.
-
createTable
Description copied from class:AbstractBodyCreate a new Table.- Specified by:
createTablein classAbstractBody- Returns:
- the new Table.
-
getSectPr
Returns theDOCXSectProf this document (equals to the last section of the whole docx file).- Returns:
- the
DOCXSectProbject.
-
getSectPr
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
Returns theDOCXHdrby the given id.- Parameters:
id- the header id.- Returns:
- the
DOCXHdrobject.
-
getNumbering
public org.openxmlformats.schemas.wordprocessingml.x2006.main.CTLvl getNumbering(BigInteger numId, BigInteger level) Returns the numbering dataCTLvlfor a specific numbering id and level.- Parameters:
numId- the numbering id (w:numId) in the documentlevel- the level number (w:ilvl) in the abstract numbering id- Returns:
- the
CTLvlcontaining the numbering data
-
addNumbering
public BigInteger addNumbering(org.openxmlformats.schemas.wordprocessingml.x2006.main.STNumberFormat.Enum format, String lvlText, BigInteger indent) Adds a new numbering definition to the document, and returns the numbering id of this new numbering.- Parameters:
format- the numbering formatlvlText- the text to display for the numbering levelindent- the indentation for the numbering- Returns:
- the numbering id for the newly added numbering definition
-
resetPrevNumberingData
public void resetPrevNumberingData()Resets the previous numbering data.This method is used to switch to new numbering group.
-