org.apache.poi.xwpf.converter.core.openxmlformats
Class OpenXMlFormatsVisitor<T,O extends Options,E extends IXWPFMasterPage>

java.lang.Object
  extended by org.apache.poi.xwpf.converter.core.openxmlformats.OpenXMlFormatsVisitor<T,O,E>
All Implemented Interfaces:
IMasterPageHandler<E>
Direct Known Subclasses:
FastPdfMapper

public abstract class OpenXMlFormatsVisitor<T,O extends Options,E extends IXWPFMasterPage>
extends Object
implements IMasterPageHandler<E>


Field Summary
protected  O options
           
protected  XWPFStylesDocument stylesDocument
           
 
Constructor Summary
OpenXMlFormatsVisitor(IOpenXMLFormatsPartProvider provider, O options)
           
 
Method Summary
protected abstract  void addNewLine(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBr br, T paragraphContainer)
           
protected  XWPFStylesDocument createStylesDocument(IOpenXMLFormatsPartProvider provider)
           
protected abstract  void endVisitDocument()
          End of visit document.
protected abstract  void endVisitParagraph(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP paragraph, T container, T paragraphContainer)
           
protected abstract  void endVisitTable(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl table, T parentContainer, T tableContainer)
           
protected abstract  void endVisitTableCell(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc cell, T tableContainer, T tableCellContainer)
           
protected  IImageExtractor getImageExtractor()
          Returns the image extractor and null otherwise.
 MasterPageManager getMasterPageManager()
           
 O getOptions()
           
 org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl getParentTable()
           
 byte[] getPictureBytes(org.openxmlformats.schemas.drawingml.x2006.picture.CTPicture picture)
           
 XWPFStylesDocument getStylesDocument()
           
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.openxmlformats.schemas.wordprocessingml.x2006.main.CTP paragraph, ListItemContext itemContext, T container)
           
protected abstract  T startVisitTable(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl table, float[] colWidths, T tableContainer)
           
protected abstract  T startVisitTableCell(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc cell, T tableContainer)
           
protected abstract  void startVisitTableRow(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRow row, T tableContainer, boolean headerRow)
           
protected  void visitAnchor(org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.CTAnchor anchor, T parentContainer)
           
protected  void visitBodyElements(org.apache.xmlbeans.XmlTokenSource token, T container)
           
protected abstract  void visitBookmark(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBookmark bookmark, org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP paragraph, T paragraphContainer)
           
protected  void visitBR(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBr br, T paragraphContainer)
           
protected  void visitCell(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc cell, T tableContainer)
           
protected  void visitDrawing(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDrawing drawing, T parentContainer)
           
protected abstract  void visitFooter(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTHdrFtr currentFooter, 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.openxmlformats.schemas.wordprocessingml.x2006.main.CTHdrFtr currentHeader, 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.openxmlformats.schemas.wordprocessingml.x2006.main.CTP paragraph, int index, T container)
           
protected  void visitParagraphBody(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP 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.openxmlformats.schemas.wordprocessingml.x2006.main.CTR run, org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP paragraph, boolean pageNumber, String url, T paragraphContainer)
           
protected abstract  void visitTab(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTPTab o, T paragraphContainer)
           
protected  void visitTable(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl table, int i, T container)
           
protected  void visitTableBody(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl table, float[] colWidths, T tableContainer)
           
protected  void visitTableCellBody(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc cell, T tableCellContainer)
           
protected  void visitTableRow(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRow row, T tableContainer)
           
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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.poi.xwpf.converter.core.IMasterPageHandler
createMasterPage, setActiveMasterPage
 

Field Detail

options

protected final O extends Options options

stylesDocument

protected final XWPFStylesDocument stylesDocument
Constructor Detail

OpenXMlFormatsVisitor

public OpenXMlFormatsVisitor(IOpenXMLFormatsPartProvider provider,
                             O options)
                      throws Exception
Throws:
Exception
Method Detail

createStylesDocument

protected XWPFStylesDocument createStylesDocument(IOpenXMLFormatsPartProvider provider)
                                           throws Exception
Throws:
Exception

getStylesDocument

public XWPFStylesDocument getStylesDocument()
Specified by:
getStylesDocument in interface IMasterPageHandler<E extends IXWPFMasterPage>

getOptions

public O getOptions()

getMasterPageManager

public MasterPageManager getMasterPageManager()

start

public void start()
           throws Exception
Main entry for visit XWPFDocument.

Parameters:
out -
Throws:
Exception

startVisitDocument

protected abstract T startVisitDocument()
                                 throws Exception
Start of visit document.

Returns:
Throws:
Exception

endVisitDocument

protected abstract void endVisitDocument()
                                  throws Exception
End of visit document.

Throws:
Exception

visitBodyElements

protected void visitBodyElements(org.apache.xmlbeans.XmlTokenSource token,
                                 T container)
                          throws Exception
Throws:
Exception

visitParagraph

protected void visitParagraph(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP paragraph,
                              int index,
                              T container)
                       throws Exception
Throws:
Exception

endVisitParagraph

protected abstract void endVisitParagraph(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP paragraph,
                                          T container,
                                          T paragraphContainer)
                                   throws Exception
Throws:
Exception

visitParagraphBody

protected void visitParagraphBody(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP paragraph,
                                  int index,
                                  T paragraphContainer)
                           throws Exception
Throws:
Exception

startVisitParagraph

protected abstract T startVisitParagraph(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP paragraph,
                                         ListItemContext itemContext,
                                         T container)
                                  throws Exception
Throws:
Exception

pageBreak

protected abstract void pageBreak()
                           throws Exception
Throws:
Exception

visitRun

protected void visitRun(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTR run,
                        org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP paragraph,
                        boolean pageNumber,
                        String url,
                        T paragraphContainer)
                 throws Exception
Throws:
Exception

visitText

protected abstract void visitText(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTText ctText,
                                  boolean pageNumber,
                                  T paragraphContainer)
                           throws Exception
Throws:
Exception

visitTab

protected abstract void visitTab(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTPTab o,
                                 T paragraphContainer)
                          throws Exception
Throws:
Exception

visitTabs

protected abstract void visitTabs(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTabs tabs,
                                  T paragraphContainer)
                           throws Exception
Throws:
Exception

visitBR

protected void visitBR(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBr br,
                       T paragraphContainer)
                throws Exception
Throws:
Exception

visitBookmark

protected abstract void visitBookmark(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBookmark bookmark,
                                      org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP paragraph,
                                      T paragraphContainer)
                               throws Exception
Throws:
Exception

addNewLine

protected abstract void addNewLine(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBr br,
                                   T paragraphContainer)
                            throws Exception
Throws:
Exception

visitTable

protected void visitTable(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl table,
                          int i,
                          T container)
                   throws Exception
Throws:
Exception

startVisitTable

protected abstract T startVisitTable(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl table,
                                     float[] colWidths,
                                     T tableContainer)
                              throws Exception
Throws:
Exception

endVisitTable

protected abstract void endVisitTable(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl table,
                                      T parentContainer,
                                      T tableContainer)
                               throws Exception
Throws:
Exception

visitTableBody

protected void visitTableBody(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl table,
                              float[] colWidths,
                              T tableContainer)
                       throws Exception
Throws:
Exception

visitTableRow

protected void visitTableRow(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRow row,
                             T tableContainer)
                      throws Exception
Throws:
Exception

startVisitTableRow

protected abstract void startVisitTableRow(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRow row,
                                           T tableContainer,
                                           boolean headerRow)
                                    throws Exception
Throws:
Exception

visitCell

protected void visitCell(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc cell,
                         T tableContainer)
                  throws Exception
Throws:
Exception

startVisitTableCell

protected abstract T startVisitTableCell(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc cell,
                                         T tableContainer)
                                  throws Exception
Throws:
Exception

visitTableCellBody

protected void visitTableCellBody(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc cell,
                                  T tableCellContainer)
                           throws Exception
Throws:
Exception

endVisitTableCell

protected abstract void endVisitTableCell(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc cell,
                                          T tableContainer,
                                          T tableCellContainer)
                                   throws Exception
Throws:
Exception

visitDrawing

protected void visitDrawing(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTDrawing drawing,
                            T parentContainer)
                     throws Exception
Throws:
Exception

visitAnchor

protected void visitAnchor(org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.CTAnchor anchor,
                           T parentContainer)
                    throws Exception
Throws:
Exception

visitInline

protected void visitInline(org.openxmlformats.schemas.drawingml.x2006.wordprocessingDrawing.CTInline inline,
                           T parentContainer)
                    throws Exception
Throws:
Exception

visitPicture

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
Throws:
Exception

visitHeaderRef

public void visitHeaderRef(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTHdrFtrRef headerRef,
                           org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSectPr sectPr,
                           E masterPage)
                    throws Exception
Specified by:
visitHeaderRef in interface IMasterPageHandler<E extends IXWPFMasterPage>
Throws:
Exception

visitHeader

protected abstract void visitHeader(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTHdrFtr currentHeader,
                                    org.openxmlformats.schemas.wordprocessingml.x2006.main.CTHdrFtrRef headerRef,
                                    org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSectPr sectPr,
                                    E masterPage)
                             throws Exception
Throws:
Exception

visitFooterRef

public void visitFooterRef(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTHdrFtrRef footerRef,
                           org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSectPr sectPr,
                           E masterPage)
                    throws Exception
Specified by:
visitFooterRef in interface IMasterPageHandler<E extends IXWPFMasterPage>
Throws:
Exception

visitFooter

protected abstract void visitFooter(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTHdrFtr currentFooter,
                                    org.openxmlformats.schemas.wordprocessingml.x2006.main.CTHdrFtrRef footerRef,
                                    org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSectPr sectPr,
                                    E masterPage)
                             throws Exception
Throws:
Exception

getImageExtractor

protected IImageExtractor getImageExtractor()
Returns the image extractor and null otherwise.

Returns:

isWordDocumentPartParsing

protected boolean isWordDocumentPartParsing()
Returns true if word/document.xml is parsing and false otherwise.

Returns:
true if word/document.xml is parsing and false otherwise.

getParentTable

public org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl getParentTable()

getPictureBytes

public byte[] getPictureBytes(org.openxmlformats.schemas.drawingml.x2006.picture.CTPicture picture)
                       throws Exception
Throws:
Exception


Copyright © 2013. All rights reserved.