T - O - E - public abstract class XWPFDocumentVisitor<T,O extends Options,E extends IXWPFMasterPage> extends Object implements IMasterPageHandler<E>
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.poi.xwpf.usermodel.XWPFDocument |
document |
protected O |
options |
protected boolean |
processingTotalPageCountField |
protected XWPFStylesDocument |
stylesDocument |
protected boolean |
totalPageFieldUsed |
protected static String |
WORD_MEDIA |
| Constructor and Description |
|---|
XWPFDocumentVisitor(org.apache.poi.xwpf.usermodel.XWPFDocument document,
O options) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
addNewLine(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBr br,
T paragraphContainer) |
protected XWPFStylesDocument |
createStylesDocument(org.apache.poi.xwpf.usermodel.XWPFDocument document) |
protected abstract void |
endVisitDocument()
End of visit document.
|
protected abstract void |
endVisitParagraph(org.apache.poi.xwpf.usermodel.XWPFParagraph paragraph,
T parentContainer,
T paragraphContainer) |
protected abstract void |
endVisitTable(org.apache.poi.xwpf.usermodel.XWPFTable table,
T parentContainer,
T tableContainer) |
protected abstract void |
endVisitTableCell(org.apache.poi.xwpf.usermodel.XWPFTableCell cell,
T tableContainer,
T tableCellContainer) |
protected void |
endVisitTableRow(org.apache.poi.xwpf.usermodel.XWPFTableRow row,
T tableContainer,
boolean firstRow,
boolean lastRow,
boolean headerRow) |
protected List<org.apache.poi.xwpf.usermodel.IBodyElement> |
getBodyElements(org.apache.poi.xwpf.usermodel.XWPFHeaderFooter part)
Returns the list of
IBodyElement of the given header/footer. |
protected IImageExtractor |
getImageExtractor()
Returns the image extractor and null otherwise.
|
MasterPageManager |
getMasterPageManager() |
O |
getOptions() |
org.apache.poi.xwpf.usermodel.XWPFPictureData |
getPictureData(org.openxmlformats.schemas.drawingml.x2006.picture.CTPicture picture)
Returns the picture data of the given picture.
|
protected org.apache.poi.xwpf.usermodel.XWPFPictureData |
getPictureDataByID(String blipId)
Returns the picture data of the given image id.
|
XWPFStylesDocument |
getStylesDocument() |
protected org.apache.poi.xwpf.usermodel.XWPFAbstractNum |
getXWPFAbstractNum(org.apache.poi.xwpf.usermodel.XWPFNum num) |
protected org.apache.poi.xwpf.usermodel.XWPFFooter |
getXWPFFooter(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTHdrFtrRef footerRef)
Returns the
XWPFFooter of the given footer reference. |
protected org.apache.poi.xwpf.usermodel.XWPFHeader |
getXWPFHeader(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTHdrFtrRef headerRef)
Returns the
XWPFHeader of the given header reference. |
protected org.apache.poi.xwpf.usermodel.XWPFNum |
getXWPFNum(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTNumPr numPr) |
protected org.apache.poi.xwpf.usermodel.XWPFStyle |
getXWPFStyle(String styleID) |
protected boolean |
isWordDocumentPartParsing()
Returns true if word/document.xml is parsing and false otherwise.
|
protected abstract void |
pageBreak() |
void |
start()
Main entry for visit XWPFDocument.
|
protected abstract T |
startVisitDocument()
Start of visit document.
|
protected abstract T |
startVisitParagraph(org.apache.poi.xwpf.usermodel.XWPFParagraph paragraph,
ListItemContext itemContext,
T parentContainer) |
protected abstract T |
startVisitTable(org.apache.poi.xwpf.usermodel.XWPFTable table,
float[] colWidths,
T tableContainer) |
protected abstract T |
startVisitTableCell(org.apache.poi.xwpf.usermodel.XWPFTableCell cell,
T tableContainer,
boolean firstRow,
boolean lastRow,
boolean firstCol,
boolean lastCol,
List<org.apache.poi.xwpf.usermodel.XWPFTableCell> vMergeCells) |
protected void |
startVisitTableRow(org.apache.poi.xwpf.usermodel.XWPFTableRow row,
T tableContainer,
int rowIndex,
boolean headerRow) |
protected void |
visitAnchor(org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.CTAnchor anchor,
T parentContainer) |
protected void |
visitBodyElements(List<org.apache.poi.xwpf.usermodel.IBodyElement> bodyElements,
T container) |
protected abstract void |
visitBookmark(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBookmark bookmark,
org.apache.poi.xwpf.usermodel.XWPFParagraph paragraph,
T paragraphContainer) |
protected void |
visitBR(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBr br,
T paragraphContainer) |
protected void |
visitCell(org.apache.poi.xwpf.usermodel.XWPFTableCell cell,
T tableContainer,
boolean firstRow,
boolean lastRow,
boolean firstCol,
boolean lastCol,
int rowIndex,
int cellIndex,
List<org.apache.poi.xwpf.usermodel.XWPFTableCell> vMergedCells) |
protected void |
visitDrawing(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDrawing drawing,
T parentContainer) |
protected abstract void |
visitEmptyRun(T paragraphContainer) |
protected abstract void |
visitFooter(org.apache.poi.xwpf.usermodel.XWPFFooter footer,
org.openxmlformats.schemas.wordprocessingml.x2006.main.CTHdrFtrRef footerRef,
org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSectPr sectPr,
E masterPage) |
void |
visitFooterRef(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTHdrFtrRef footerRef,
org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSectPr sectPr,
E masterPage) |
protected abstract void |
visitHeader(org.apache.poi.xwpf.usermodel.XWPFHeader header,
org.openxmlformats.schemas.wordprocessingml.x2006.main.CTHdrFtrRef headerRef,
org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSectPr sectPr,
E masterPage) |
void |
visitHeaderRef(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTHdrFtrRef headerRef,
org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSectPr sectPr,
E masterPage) |
protected void |
visitInline(org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.CTInline inline,
T parentContainer) |
protected void |
visitParagraph(org.apache.poi.xwpf.usermodel.XWPFParagraph paragraph,
int index,
T container)
Visit the given paragraph.
|
protected void |
visitParagraphBody(org.apache.poi.xwpf.usermodel.XWPFParagraph paragraph,
int index,
T paragraphContainer) |
protected abstract void |
visitPicture(org.openxmlformats.schemas.drawingml.x2006.picture.CTPicture picture,
Float offsetX,
org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.STRelFromH.Enum relativeFromH,
Float offsetY,
org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.STRelFromV.Enum relativeFromV,
org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.STWrapText.Enum wrapText,
T parentContainer) |
protected void |
visitRun(org.apache.poi.xwpf.usermodel.XWPFRun run,
boolean pageNumber,
String url,
T paragraphContainer) |
protected void |
visitStyleText(org.apache.poi.xwpf.usermodel.XWPFRun run,
String text)
Text styles handling, fonts, highlighting, background colors, subscript, superscript, strikes (single strikes) etc.
|
protected abstract void |
visitTab(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTPTab o,
T paragraphContainer) |
protected void |
visitTable(org.apache.poi.xwpf.usermodel.XWPFTable table,
int index,
T container) |
protected void |
visitTableBody(org.apache.poi.xwpf.usermodel.XWPFTable table,
float[] colWidths,
T tableContainer) |
protected void |
visitTableCellBody(org.apache.poi.xwpf.usermodel.XWPFTableCell cell,
List<org.apache.poi.xwpf.usermodel.XWPFTableCell> vMergeCells,
T tableCellContainer) |
protected void |
visitTableRow(org.apache.poi.xwpf.usermodel.XWPFTableRow row,
float[] colWidths,
T tableContainer,
boolean firstRow,
boolean lastRowIfNoneVMerge,
int rowIndex,
int rowsSize) |
protected abstract void |
visitTabs(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTabs tabs,
T paragraphContainer) |
protected abstract void |
visitText(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTText ctText,
boolean pageNumber,
T paragraphContainer) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateMasterPage, setActiveMasterPageprotected static final String WORD_MEDIA
protected final org.apache.poi.xwpf.usermodel.XWPFDocument document
protected final XWPFStylesDocument stylesDocument
protected boolean processingTotalPageCountField
protected boolean totalPageFieldUsed
protected XWPFStylesDocument createStylesDocument(org.apache.poi.xwpf.usermodel.XWPFDocument document) throws org.apache.xmlbeans.XmlException, IOException
org.apache.xmlbeans.XmlExceptionIOExceptionpublic XWPFStylesDocument getStylesDocument()
getStylesDocument in interface IMasterPageHandler<E extends IXWPFMasterPage>public O getOptions()
public MasterPageManager getMasterPageManager()
public void start()
throws Exception
out - Exceptionprotected abstract T startVisitDocument() throws Exception
Exceptionprotected abstract void endVisitDocument()
throws Exception
Exceptionprotected void visitBodyElements(List<org.apache.poi.xwpf.usermodel.IBodyElement> bodyElements, T container) throws Exception
Exceptionprotected void visitParagraph(org.apache.poi.xwpf.usermodel.XWPFParagraph paragraph,
int index,
T container)
throws Exception
paragraph - index - container - Exceptionprotected abstract T startVisitParagraph(org.apache.poi.xwpf.usermodel.XWPFParagraph paragraph, ListItemContext itemContext, T parentContainer) throws Exception
Exceptionprotected abstract void endVisitParagraph(org.apache.poi.xwpf.usermodel.XWPFParagraph paragraph,
T parentContainer,
T paragraphContainer)
throws Exception
Exceptionprotected void visitParagraphBody(org.apache.poi.xwpf.usermodel.XWPFParagraph paragraph,
int index,
T paragraphContainer)
throws Exception
Exceptionprotected org.apache.poi.xwpf.usermodel.XWPFNum getXWPFNum(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTNumPr numPr)
protected org.apache.poi.xwpf.usermodel.XWPFAbstractNum getXWPFAbstractNum(org.apache.poi.xwpf.usermodel.XWPFNum num)
protected abstract void visitEmptyRun(T paragraphContainer) throws Exception
Exceptionprotected void visitRun(org.apache.poi.xwpf.usermodel.XWPFRun run,
boolean pageNumber,
String url,
T paragraphContainer)
throws Exception
Exceptionprotected void visitStyleText(org.apache.poi.xwpf.usermodel.XWPFRun run,
String text)
throws Exception
run - text - Exceptionprotected abstract void visitText(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTText ctText,
boolean pageNumber,
T paragraphContainer)
throws Exception
Exceptionprotected abstract void visitTab(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTPTab o,
T paragraphContainer)
throws Exception
Exceptionprotected abstract void visitTabs(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTabs tabs,
T paragraphContainer)
throws Exception
Exceptionprotected void visitBR(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBr br,
T paragraphContainer)
throws Exception
Exceptionprotected abstract void visitBookmark(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBookmark bookmark,
org.apache.poi.xwpf.usermodel.XWPFParagraph paragraph,
T paragraphContainer)
throws Exception
Exceptionprotected abstract void addNewLine(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBr br,
T paragraphContainer)
throws Exception
Exceptionprotected void visitTable(org.apache.poi.xwpf.usermodel.XWPFTable table,
int index,
T container)
throws Exception
Exceptionprotected void visitTableBody(org.apache.poi.xwpf.usermodel.XWPFTable table,
float[] colWidths,
T tableContainer)
throws Exception
Exceptionprotected abstract T startVisitTable(org.apache.poi.xwpf.usermodel.XWPFTable table, float[] colWidths, T tableContainer) throws Exception
Exceptionprotected abstract void endVisitTable(org.apache.poi.xwpf.usermodel.XWPFTable table,
T parentContainer,
T tableContainer)
throws Exception
Exceptionprotected void visitTableRow(org.apache.poi.xwpf.usermodel.XWPFTableRow row,
float[] colWidths,
T tableContainer,
boolean firstRow,
boolean lastRowIfNoneVMerge,
int rowIndex,
int rowsSize)
throws Exception
Exceptionprotected void startVisitTableRow(org.apache.poi.xwpf.usermodel.XWPFTableRow row,
T tableContainer,
int rowIndex,
boolean headerRow)
throws Exception
Exceptionprotected void endVisitTableRow(org.apache.poi.xwpf.usermodel.XWPFTableRow row,
T tableContainer,
boolean firstRow,
boolean lastRow,
boolean headerRow)
throws Exception
Exceptionprotected void visitCell(org.apache.poi.xwpf.usermodel.XWPFTableCell cell,
T tableContainer,
boolean firstRow,
boolean lastRow,
boolean firstCol,
boolean lastCol,
int rowIndex,
int cellIndex,
List<org.apache.poi.xwpf.usermodel.XWPFTableCell> vMergedCells)
throws Exception
Exceptionprotected void visitTableCellBody(org.apache.poi.xwpf.usermodel.XWPFTableCell cell,
List<org.apache.poi.xwpf.usermodel.XWPFTableCell> vMergeCells,
T tableCellContainer)
throws Exception
Exceptionprotected abstract T startVisitTableCell(org.apache.poi.xwpf.usermodel.XWPFTableCell cell, T tableContainer, boolean firstRow, boolean lastRow, boolean firstCol, boolean lastCol, List<org.apache.poi.xwpf.usermodel.XWPFTableCell> vMergeCells) throws Exception
Exceptionprotected abstract void endVisitTableCell(org.apache.poi.xwpf.usermodel.XWPFTableCell cell,
T tableContainer,
T tableCellContainer)
throws Exception
Exceptionprotected org.apache.poi.xwpf.usermodel.XWPFStyle getXWPFStyle(String styleID)
protected boolean isWordDocumentPartParsing()
public void visitHeaderRef(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTHdrFtrRef headerRef,
org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSectPr sectPr,
E masterPage)
throws Exception
visitHeaderRef in interface IMasterPageHandler<E extends IXWPFMasterPage>Exceptionprotected abstract void visitHeader(org.apache.poi.xwpf.usermodel.XWPFHeader header,
org.openxmlformats.schemas.wordprocessingml.x2006.main.CTHdrFtrRef headerRef,
org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSectPr sectPr,
E masterPage)
throws Exception
Exceptionpublic void visitFooterRef(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTHdrFtrRef footerRef,
org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSectPr sectPr,
E masterPage)
throws Exception
visitFooterRef in interface IMasterPageHandler<E extends IXWPFMasterPage>Exceptionprotected abstract void visitFooter(org.apache.poi.xwpf.usermodel.XWPFFooter footer,
org.openxmlformats.schemas.wordprocessingml.x2006.main.CTHdrFtrRef footerRef,
org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSectPr sectPr,
E masterPage)
throws Exception
Exceptionprotected List<org.apache.poi.xwpf.usermodel.IBodyElement> getBodyElements(org.apache.poi.xwpf.usermodel.XWPFHeaderFooter part)
IBodyElement of the given header/footer. We do that because
XWPFHeaderFooter.getBodyElements() doesn't contains the //
part - protected org.apache.poi.xwpf.usermodel.XWPFHeader getXWPFHeader(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTHdrFtrRef headerRef)
throws org.apache.xmlbeans.XmlException,
IOException
XWPFHeader of the given header reference.headerref - the header reference.org.apache.xmlbeans.XmlExceptionIOExceptionprotected org.apache.poi.xwpf.usermodel.XWPFFooter getXWPFFooter(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTHdrFtrRef footerRef)
throws org.apache.xmlbeans.XmlException,
IOException
XWPFFooter of the given footer reference.footerRef - the footer reference.org.apache.xmlbeans.XmlExceptionIOExceptionprotected void visitDrawing(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDrawing drawing,
T parentContainer)
throws Exception
Exceptionprotected void visitAnchor(org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.CTAnchor anchor,
T parentContainer)
throws Exception
Exceptionprotected void visitInline(org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.CTInline inline,
T parentContainer)
throws Exception
Exceptionprotected org.apache.poi.xwpf.usermodel.XWPFPictureData getPictureDataByID(String blipId)
blipId - protected IImageExtractor getImageExtractor()
public org.apache.poi.xwpf.usermodel.XWPFPictureData getPictureData(org.openxmlformats.schemas.drawingml.x2006.picture.CTPicture picture)
picture - protected abstract void visitPicture(org.openxmlformats.schemas.drawingml.x2006.picture.CTPicture picture,
Float offsetX,
org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.STRelFromH.Enum relativeFromH,
Float offsetY,
org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.STRelFromV.Enum relativeFromV,
org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.STWrapText.Enum wrapText,
T parentContainer)
throws Exception
ExceptionCopyright © 2016. All Rights Reserved.