public abstract class XWPFHeaderFooter extends POIXMLDocumentPart implements IBody
DEFAULT_XML_OPTIONS| Modifier | Constructor and Description |
|---|---|
protected |
XWPFHeaderFooter() |
|
XWPFHeaderFooter(POIXMLDocumentPart parent,
PackagePart part,
PackageRelationship rel) |
| Modifier and Type | Method and Description |
|---|---|
org.openxmlformats.schemas.wordprocessingml.x2006.main.CTHdrFtr |
_getHdrFtr() |
String |
addPictureData(byte[] pictureData,
int format)
Adds a picture to the document.
|
String |
addPictureData(InputStream is,
int format)
Adds a picture to the document.
|
List<XWPFPictureData> |
getAllPackagePictures()
get all Pictures in this package
|
List<XWPFPictureData> |
getAllPictures() |
List<IBodyElement> |
getBodyElements()
Returns an Iterator with paragraphs and tables,
in the order that they occur in the text.
|
List<XWPFParagraph> |
getListParagraph()
get a List of all Paragraphs
|
POIXMLDocumentPart |
getOwner() |
XWPFParagraph |
getParagraph(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP p)
if there is a corresponding
XWPFParagraph of the parameter ctTable in the paragraphList of this header or footer
the method will return this paragraph
if there is no corresponding XWPFParagraph the method will return null |
XWPFParagraph |
getParagraphArray(int pos)
Returns the paragraph that holds
the text of the header or footer.
|
List<XWPFParagraph> |
getParagraphs()
Returns the paragraph(s) that holds
the text of the header or footer.
|
POIXMLDocumentPart |
getPart()
returns the Part, to which the body belongs, which you need for adding relationship to other parts
|
XWPFPictureData |
getPictureDataByID(String blipID)
returns the PictureData by blipID
|
XWPFTable |
getTable(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl ctTable)
|
XWPFTable |
getTableArray(int pos)
Returns the table at position pos
|
XWPFTableCell |
getTableCell(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc cell)
get the TableCell which belongs to the TableCell
|
List<XWPFTable> |
getTables()
Return the table(s) that holds the text
of the header or footer, for complex cases
where a paragraph isn't used.
|
String |
getText()
Returns the textual content of the header/footer,
by flattening out the text of its paragraph(s)
|
XWPFDocument |
getXWPFDocument()
Return XWPFDocument
|
XWPFParagraph |
insertNewParagraph(org.apache.xmlbeans.XmlCursor cursor)
add a new paragraph at position of the cursor
|
XWPFTable |
insertNewTbl(org.apache.xmlbeans.XmlCursor cursor)
inserts a new Table at the cursor position.
|
void |
insertTable(int pos,
XWPFTable table)
inserts an existing XWPFTable to the arrays bodyElements and tables
|
protected void |
onDocumentRead()
Fired when a package part is read
|
void |
readHdrFtr() |
void |
setHeaderFooter(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTHdrFtr headerFooter)
set a new headerFooter
|
void |
setXWPFDocument(XWPFDocument doc) |
addRelation, clearMemoryPackagePart, commit, createRelationship, createRelationship, createRelationship, getPackagePart, getPackageRelationship, getParent, getRelationById, getRelationCounter, getRelationId, getRelations, getTargetPart, onDocumentCreate, onDocumentRemove, onSave, read, rebase, removeRelation, removeRelation, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetPartTypeprotected XWPFHeaderFooter()
public XWPFHeaderFooter(POIXMLDocumentPart parent, PackagePart part, PackageRelationship rel) throws IOException
IOExceptionprotected void onDocumentRead()
throws IOException
POIXMLDocumentPartonDocumentRead in class POIXMLDocumentPartIOException@Internal public org.openxmlformats.schemas.wordprocessingml.x2006.main.CTHdrFtr _getHdrFtr()
public List<IBodyElement> getBodyElements()
IBodygetBodyElements in interface IBodypublic List<XWPFParagraph> getParagraphs()
getParagraphs in interface IBodypublic List<XWPFTable> getTables() throws ArrayIndexOutOfBoundsException
getTables in interface IBodyArrayIndexOutOfBoundsExceptionpublic String getText()
public void setHeaderFooter(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTHdrFtr headerFooter)
public XWPFTable getTable(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl ctTable)
public XWPFParagraph getParagraph(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP p)
XWPFParagraph of the parameter ctTable in the paragraphList of this header or footer
the method will return this paragraph
if there is no corresponding XWPFParagraph the method will return nullgetParagraph in interface IBodyp - is instance of CTP and is searching for an XWPFParagraphpublic XWPFParagraph getParagraphArray(int pos)
getParagraphArray in interface IBodypublic List<XWPFParagraph> getListParagraph()
XWPFParagraphpublic List<XWPFPictureData> getAllPictures()
public List<XWPFPictureData> getAllPackagePictures()
public String addPictureData(byte[] pictureData, int format) throws InvalidFormatException
pictureData - The picture dataformat - The format of the picture.getAllPictures() .InvalidFormatExceptionpublic String addPictureData(InputStream is, int format) throws InvalidFormatException, IOException
is - The stream to read image fromformat - The format of the picture.getAllPictures() .InvalidFormatExceptionIOExceptionpublic XWPFPictureData getPictureDataByID(String blipID)
blipID - Exceptionpublic XWPFParagraph insertNewParagraph(org.apache.xmlbeans.XmlCursor cursor)
insertNewParagraph in interface IBodycursor - public XWPFTable insertNewTbl(org.apache.xmlbeans.XmlCursor cursor)
IBodyinsertNewTbl in interface IBodycursor - public POIXMLDocumentPart getOwner()
public XWPFTable getTableArray(int pos)
getTableArray in interface IBodyIBody.getTableArray(int)public void insertTable(int pos,
XWPFTable table)
insertTable in interface IBodypos - table - public void readHdrFtr()
public XWPFTableCell getTableCell(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc cell)
getTableCell in interface IBodycell - public void setXWPFDocument(XWPFDocument doc)
public XWPFDocument getXWPFDocument()
IBodygetXWPFDocument in interface IBodypublic POIXMLDocumentPart getPart()
getPart in interface IBodyIBody.getPart()Copyright © 2020. All rights reserved.