/**
* Set the sheetname for this sheet. (this appears in the tabs at the bottom)
* @param sheetName the name of the sheet
- * @see {@link org.apache.poi.ss.util.WorkbookUtil#createSafeSheetName(String nameProposal)}
+ * @see org.apache.poi.ss.util.WorkbookUtil#createSafeSheetName(String nameProposal)
* for a safe way to create valid names
* @throws IllegalArgumentException if sheet name will cause excel to crash.
*/
// --> start option flags
/**
* @return the condition data type
- * @see org.apache.poi.hssf.usermodel.DVConstraint.ValidationType
+ * @see org.apache.poi.ss.usermodel.DataValidationConstraint.ValidationType
*/
public int getDataType() {
return opt_data_type.getValue(_option_flags);
/**
* @return the condition error style
- * @see org.apache.poi.hssf.usermodel.HSSFDataValidation.ErrorStyle
+ * @see org.apache.poi.ss.usermodel.DataValidation.ErrorStyle
*/
public int getErrorStyle() {
return opt_error_style.getValue(_option_flags);
* can be either standard Excel formulas or formatted number values. If the expression starts
* with '=' it is parsed as a formula, otherwise it is parsed as a formatted number.
*
- * @param validationType one of {@link ValidationType#ANY}, {@link ValidationType#DECIMAL},
- * {@link ValidationType#INTEGER}, {@link ValidationType#TEXT_LENGTH}
- * @param comparisonOperator any constant from {@link OperatorType} enum
+ * @param validationType one of {@link org.apache.poi.ss.usermodel.DataValidationConstraint.ValidationType#ANY},
+ * {@link org.apache.poi.ss.usermodel.DataValidationConstraint.ValidationType#DECIMAL},
+ * {@link org.apache.poi.ss.usermodel.DataValidationConstraint.ValidationType#INTEGER},
+ * {@link org.apache.poi.ss.usermodel.DataValidationConstraint.ValidationType#TEXT_LENGTH}
+ * @param comparisonOperator any constant from {@link org.apache.poi.ss.usermodel.DataValidationConstraint.OperatorType} enum
* @param expr1 date formula (when first char is '=') or formatted number value
* @param expr2 date formula (when first char is '=') or formatted number value
*/
* formatted times, two formats are supported: "HH:MM" or "HH:MM:SS". This is contrary to
* Excel which uses the default time format from the OS.
*
- * @param comparisonOperator constant from {@link OperatorType} enum
+ * @param comparisonOperator constant from {@link org.apache.poi.ss.usermodel.DataValidationConstraint.OperatorType} enum
* @param expr1 date formula (when first char is '=') or formatted time value
* @param expr2 date formula (when first char is '=') or formatted time value
*/
* the same convention). To parse formatted dates, a date format needs to be specified. This
* is contrary to Excel which uses the default short date format from the OS.
*
- * @param comparisonOperator constant from {@link OperatorType} enum
+ * @param comparisonOperator constant from {@link org.apache.poi.ss.usermodel.DataValidationConstraint.OperatorType} enum
* @param expr1 date formula (when first char is '=') or formatted date value
* @param expr2 date formula (when first char is '=') or formatted date value
* @param dateFormat ignored if both expr1 and expr2 are formulas. Default value is "YYYY/MM/DD"
* contained strings will be written to the Shared String tabel (SSTRecord) within
* the Workbook.
*
- * @param wb sheet's matching low level Workbook structure containing the SSTRecord.
+ * @param records a collection of sheet's records.
+ * @param offset the offset to search at
* @see org.apache.poi.hssf.record.LabelRecord
* @see org.apache.poi.hssf.record.LabelSSTRecord
* @see org.apache.poi.hssf.record.SSTRecord
*
* @param sheetname the name for the new sheet. Note - certain length limits
* apply. See {@link #setSheetName(int, String)}.
- * @see {@link org.apache.poi.ss.util.WorkbookUtil#createSafeSheetName(String nameProposal)}
- * for a safe way to create valid names
+ * @see org.apache.poi.ss.util.WorkbookUtil#createSafeSheetName(String nameProposal)
+ * for a safe way to create valid names
* @return HSSFSheet representing the new sheet.
* @throws IllegalArgumentException
* if there is already a sheet present with a case-insensitive
* returns the Part, to which the body belongs, which you need for adding relationship to other parts
* Actually it is needed of the class XWPFTableCell. Because you have to know to which part the tableCell
* belongs.
- * @return
+ * @return the Part, to which the body belongs
*/
IBody getPart();
/**
* get the PartType of the body, for example
* DOCUMENT, HEADER, FOOTER, FOOTNOTE,
- * @return
+ * @return the PartType of the body
*/
BodyType getPartType();
* the method will return this table
* if there is no corresponding {@link XWPFTable} the method will return null
* @param ctTable
- * @return
*/
public XWPFTable getTable(CTTbl ctTable);
/**
*inserts a new paragraph at position of the cursor
* @param cursor
- * @return
*/
public XWPFParagraph insertNewParagraph(XmlCursor cursor);
/**
* inserts a new Table at the cursor position.
* @param cursor
- * @return
*/
public XWPFTable insertNewTbl(XmlCursor cursor);
/**
* returns the TableCell to which the Table belongs
* @param cell
- * @return
*/
XWPFTableCell getTableCell(CTTc cell);
/**
* returns an Iterator with paragraphs and tables
* @see org.apache.poi.xwpf.usermodel.IBody#getBodyElements()
- * @return
*/
public List<IBodyElement> getBodyElements(){
return Collections.unmodifiableList(bodyElements);
/**
* @see org.apache.poi.xwpf.usermodel.IBody#getTables()
- * @return
*/
public List<XWPFTable> getTables(){
return Collections.unmodifiableList(tables);
/**
*
- * @return
+ * @return the list of footers
*/
public List<XWPFFooter> getFooterList(){
return Collections.unmodifiableList(footers);
}
- /**
- *
- * @param pos
- * @return
- */
public XWPFFooter getFooterArray(int pos){
return footers.get(pos);
}
/**
*
- * @return
+ * @return the list of headers
*/
public List<XWPFHeader> getHeaderList(){
return Collections.unmodifiableList(headers);
}
- /**
- *
- * @param pos
- * @return
- */
public XWPFHeader getHeaderArray(int pos){
return headers.get(pos);
}
- /**
- *
- * @param table
- * @return
- */
public String getTblStyle(XWPFTable table){
return table.getStyleID();
}
- /**
- *
- * @param id
- * @return
- */
public XWPFHyperlink getHyperlinkByID(String id) {
Iterator<XWPFHyperlink> iter = hyperlinks.iterator();
while(iter.hasNext())
return null;
}
- /**
- *
- * @param id
- * @return
- */
public XWPFFootnote getFootnoteByID(int id) {
return footnotes.get(id);
}
- /**
- *
- * @param id
- * @return
- */
public XWPFFootnote getEndnoteByID(int id) {
return endnotes.get(id);
}
- /**
- *
- * @return
- */
public Collection<XWPFFootnote> getFootnotes() {
return Collections.unmodifiableCollection(footnotes == null ? new ArrayList<XWPFFootnote>() : footnotes.values());
}
- /**
- *
- * @return
- */
public XWPFHyperlink[] getHyperlinks() {
return hyperlinks.toArray(
new XWPFHyperlink[hyperlinks.size()]
/**
* add a new paragraph at position of the cursor
* @param cursor
- * @return
*/
public XWPFParagraph insertNewParagraph(XmlCursor cursor){
if(isCursorInBody(cursor)){
return null;
}
- /**
- *
- * @param cursor
- * @return
- */
public XWPFTable insertNewTbl(XmlCursor cursor) {
if(isCursorInBody(cursor)){
String uri = CTTbl.type.getName().getNamespaceURI();
/**
* verifies that cursor is on the right position
* @param cursor
- * @return
*/
private boolean isCursorInBody(XmlCursor cursor) {
XmlCursor verify = cursor.newCursor();
/**
* get position of the paragraph
* @param p
- * @return
*/
public Integer getPosOfParagraph(XWPFParagraph p){
int i, pos = 0;
}
/**
- * get the LastParagraph of the document
- * @return
+ * @return the LastParagraph of the document
*/
public XWPFParagraph getLastParagraph(){
int lastPos = paragraphs.toArray().length - 1;
}
}
- /**Replace content of table in array tables at position pos with a
- * @param pos, table
+ /**Replace content of table in array tables at position pos with a
+ * @param pos
+ * @param table
*/
public void setTable(int pos, XWPFTable table){
tables.set(pos, table);
/**
* inserts an existing XWPFTable to the arrays bodyElements and tables
- * @param i
+ * @param pos
* @param table
*/
public void insertTable(int pos, XWPFTable table) {
tables.add(i, table);
}
- /**
- *
- * @return
- */
public List<XWPFPictureData> getAllPictures() {
if(pictures == null){
pictures = new ArrayList<XWPFPictureData>();
}
/**
- * get all Pictures in this package
- * @return
+ * @return all Pictures in this package
*/
public List<XWPFPictureData> getAllPackagePictures(){
List<XWPFPictureData> pkgpictures = new ArrayList<XWPFPictureData>();
/**
* Adds a picture to the document.
*
- * @param is The stream to read image from
+ * @param pictureData The bytes to read image from
* @param format The format of the picture.
*
* @return the index to this picture (0 based), the added picture can be obtained from {@link #getAllPictures()} .
/**
* get the next free ImageNumber
* @param format
- * @return
+ * @return the next free ImageNumber
* @throws InvalidFormatException
*/
public int getNextPicNameNumber(int format) throws InvalidFormatException{
/**
* get Styles
- * @return
+ * @return styles for this document
*/
public XWPFStyles getStyles(){
return styles;
/**
* get the paragraph with the CTP class p
+ *
* @param p
- * @return
+ * @return the paragraph with the CTP class p
*/
public XWPFParagraph getParagraph(CTP p){
for(int i=0; i<getParagraphs().size(); i++){
* get a table by its CTTbl-Object
* @param ctTbl
* @see org.apache.poi.xwpf.usermodel.IBody#getTable(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl)
- * @return
+ * @return a table by its CTTbl-Object or null
*/
public XWPFTable getTable(CTTbl ctTbl) {
for(int i=0; i<tables.size(); i++){
/**
* get the PartType of the body, for example
- * DOCUMENT, HEADER, FOOTER, FOOTNOTE,
- * @return
+ * DOCUMENT, HEADER, FOOTER, FOOTNOTE,
+ *
* @see org.apache.poi.xwpf.usermodel.IBody#getPartType()
*/
public BodyType getPartType() {
/**
* get the TableCell which belongs to the TableCell
- * @param o
- * @return
+ * @param cell
*/
public XWPFTableCell getTableCell(CTTc cell) {
XmlCursor cursor = cell.newCursor();
/**
* reads the document
- * @overide onDocumentRead of class {@link POIXMLDocumentPart}
*/
@Override
protected void onDocumentRead(){
* the method will return this table
* if there is no corresponding {@link XWPFTable} the method will return null
* @param ctTable
- * @return
*/
public XWPFTable getTable(CTTbl ctTable){
for (XWPFTable table : tables) {
/**
* get all Pictures in this package
- * @return
+ * @return all Pictures in this package
*/
public List<XWPFPictureData> getAllPackagePictures(){
List<XWPFPictureData> pkgpictures = new ArrayList<XWPFPictureData>();
/**
* Adds a picture to the document.
*
- * @param is The stream to read image from
+ * @param pictureData The picture bytes
* @param format The format of the picture.
*
* @return the index to this picture (0 based), the added picture can be obtained from {@link #getAllPictures()} .
/**
* get the next free ImageNumber
* @param format
- * @return
+ * @return the next free ImageNumber
*/
public int getNextPicNameNumber(int format){
int img = getAllPackagePictures().size()+1;
/**
* Add the picture to drawing relations
*
- * @param img the PictureData of the Picture,
+ * @param pictureData the picture bytes
+ * @param format the picture format
*/
public PackageRelationship addPictureReference(byte[] pictureData, int format){
int imageNumber = getNextPicNameNumber(format);
/**
* Add the picture to drawing relations
*
- * @param img the PictureData of the Picture,
+ * @param is the stream to read picture data from
*/
public PackageRelationship addPictureReference(InputStream is, int format){
/**
* add a new paragraph at position of the cursor
* @param cursor
- * @return
+ * @return the inserted paragraph
*/
public XWPFParagraph insertNewParagraph(XmlCursor cursor){
if(isCursorInHdrF(cursor)){
/**
*
* @param cursor
- * @return
+ * @return the inserted table
*/
public XWPFTable insertNewTbl(XmlCursor cursor) {
if(isCursorInHdrF(cursor)){
/**
* verifies that cursor is on the right position
* @param cursor
- * @return
*/
private boolean isCursorInHdrF(XmlCursor cursor) {
XmlCursor verify = cursor.newCursor();
/**
* inserts an existing XWPFTable to the arrays bodyElements and tables
- * @param i
+ * @param pos
* @param table
*/
public void insertTable(int pos, XWPFTable table) {
/**
* get the TableCell which belongs to the TableCell
- * @param o
- * @return
+ * @param cell
*/
public XWPFTableCell getTableCell(CTTc cell) {
XmlCursor cursor = cell.newCursor();
*return the abstractNumID
*If the AbstractNumID not exists
*return null
- * @param num
+ * @param numID
* @return abstractNumID
*/
public BigInteger getAbstractNumID(BigInteger numID){
* If it finds the string, it will return true and the position of the String
* will be saved in the parameter startPos.
* @param searched
- * @param pos
- * @return
+ * @param startPos
*/
public TextSegement searchText(String searched,PositionInParagraph startPos){
/**
* insert a new Run in RunArray
* @param pos
- * @return
+ * @return the inserted run
*/
public XWPFRun insertNewRun(int pos){
if (pos >= 0 && pos <= paragraph.sizeOfRArray()) {
/**
* get a Text
- * @param posList
- * @return
+ * @param segment
*/
public String getText(TextSegement segment){
int runBegin = segment.getBeginRun();
/**
* removes a Run at the position pos in the paragraph
* @param pos
- * @return
+ * @return true if the run was removed
*/
public boolean removeRun(int pos){
if (pos >= 0 && pos < paragraph.sizeOfRArray()){
/**
* adds a new Run to the Paragraph
- * @param r
- * @return
*/
public void addRun(XWPFRun r){
runs.add(r);
/**
* return the XWPFRun-Element which owns the CTR run-Element
- * @param r
- * @return
*/
public XWPFRun getRun(CTR r){
for(int i=0; i < getRuns().size(); i++){
/**
* get StyleID of the linked Style
- * @return
*/
public String getLinkStyleID(){
if (ctStyle.getLink()!=null)
/**
* get StyleID of the next style
- * @return
*/
public String getNextStyleID(){
if(ctStyle.getNext()!=null)
/**
* compares the names of the Styles
* @param compStyle
- * @return
*/
public boolean hasSameName(XWPFStyle compStyle){
CTStyle ctCompStyle = compStyle.getCTStyle();
/**
* get latentstyles
- * @return
*/
public XWPFLatentStyles getLatentStyles() {
return latentStyles;
/**
* get the style with the same name
* if this style is not existing, return null
- * @param style
- * @return
*/
public XWPFStyle getStyleWithSameName(XWPFStyle style){
for (XWPFStyle ownStyle : listStyle) {
/**
* inserts a new tablerow
* @param pos
- * @return
+ * @return the inserted row
*/
public XWPFTableRow insertNewTableRow(int pos){
if(pos >= 0 && pos <= tableRows.size()){
return false;
}
- /**
- *
- * @param pos
- * @return
- */
public List<XWPFTableRow> getRows() {
return tableRows;
}
/**
* returns the XWPFRow which belongs to the CTRow row
* if this row is not existing in the table null will be returned
- * @param row
- * @return
*/
public XWPFTableRow getRow(CTRow row) {
for(int i=0; i<getRows().size(); i++){
/**
* returns an Iterator with paragraphs and tables
* @see org.apache.poi.xwpf.usermodel.IBody#getBodyElements()
- * @return
*/
public List<IBodyElement> getBodyElements(){
return Collections.unmodifiableList(bodyElements);
/**
* returns a list of paragraphs
- * @return
*/
public List<XWPFParagraph> getParagraphs(){
return paragraphs;
/**
* add a new paragraph at position of the cursor
* @param cursor
- * @return
+ * @return the inserted paragraph
*/
public XWPFParagraph insertNewParagraph(XmlCursor cursor){
if(!isCursorInTableCell(cursor))
return newP;
}
- /**
- *
- * @param cursor
- * @return
- */
public XWPFTable insertNewTbl(XmlCursor cursor) {
if(isCursorInTableCell(cursor)){
String uri = CTTbl.type.getName().getNamespaceURI();
/**
* verifies that cursor is on the right position
- * @param cursor
- * @return
*/
private boolean isCursorInTableCell(XmlCursor cursor) {
XmlCursor verify = cursor.newCursor();
/**
- * @see org.apache.poi.xwpf.usermodel.IBodyPart#getTableArray(int)
+ * @see org.apache.poi.xwpf.usermodel.IBody#getTableArray(int)
*/
public XWPFTable getTableArray(int pos) {
if(pos > 0 && pos < tables.size()){
/**
- * @see org.apache.poi.xwpf.usermodel.IBodyPart#getTables()
+ * @see org.apache.poi.xwpf.usermodel.IBody#getTables()
*/
public List<XWPFTable> getTables() {
return Collections.unmodifiableList(tables);
/**
* get the TableCell which belongs to the TableCell
- * @param o
- * @return
*/
public XWPFTableCell getTableCell(CTTc cell) {
XmlCursor cursor = cell.newCursor();
return tableCell;
}
- /**
- * @param pos
- * @return
- */
public XWPFTableCell getCell(int pos) {
if (pos >= 0 && pos < ctRow.sizeOfTcArray()) {
return getTableCells().get(pos);
/**
* adds a new TableCell at the end of this tableRow
- * @return
*/
public XWPFTableCell addNewTableCell(){
CTTc cell = ctRow.addNewTc();
/**
* returns the XWPFTableCell which belongs to the CTTC cell
* if there is no XWPFTableCell which belongs to the parameter CTTc cell null will be returned
- * @param cell
- * @return
*/
public XWPFTableCell getTableCell(CTTc cell) {
for(int i=0; i<tableCells.size(); i++){
* Return first index >= bytePos that is in table\r
*\r
* @param bytePos\r
- * @return\r
+ * @return first index greater or equal to bytePos that is in table\r
*/\r
public int lookIndexForward(int bytePos);\r
\r
* Return last index <= bytePos that is in table\r
*\r
* @param bytePos\r
- * @return\r
+ * @return last index less of equal to bytePos that is in table\r
*/\r
public int lookIndexBackward(int bytePos);\r
\r