return new XSSFAutoFilter(this);
}
- /**
- * Creates a new Table, and associates it with this Sheet. The table does
- * not yet have an area defined and needs to be initialized by calling
- * {@link XSSFTable#setArea(AreaReference)}.
- *
- * @deprecated Use {@link #createTable(AreaReference))} instead
- */
- @Deprecated
- @Removal(version = "4.2.0")
- public XSSFTable createTable() {
- return createTable(null);
- }
-
/**
* Creates a new Table, and associates it with this Sheet.
* <p>
}
return tableColumns;
}
-
+
/**
- * Note this list is static - once read, it does not notice later changes to the underlying column structures
- * To clear the cache, call {@link #updateHeaders}
- *
- * @deprecated Use {@link XSSFTableColumn#getXmlColumnPr()} instead.
- *
- * @return List of XSSFXmlColumnPr
+ * Use {@link XSSFTableColumn#getXmlColumnPr()} instead.
*/
- @Deprecated
- @Removal(version="4.2.0")
- public List<XSSFXmlColumnPr> getXmlColumnPrs() {
+ private List<XSSFXmlColumnPr> getXmlColumnPrs() {
if (xmlColumnPrs == null) {
xmlColumnPrs = new ArrayList<>();
for (XSSFTableColumn column: getColumns()) {
ctTable.setDisplayName(name);
}
- /**
- * @deprecated Use {@link #getColumnCount()} instead.
- *
- * @return the number of mapped table columns (see Open Office XML Part 4: chapter 3.5.1.4)
- */
- @Deprecated
- @Removal(version = "4.2.0")
- public long getNumberOfMappedColumns() {
- return ctTable.getTableColumns().getCount();
- }
-
/**
* Get the area reference for the cells which this table covers. The area
* includes header rows and totals rows.
XSSFSheet sheet = outputWorkbook.createSheet();
//Create
- XSSFTable outputTable = sheet.createTable();
+ XSSFTable outputTable = sheet.createTable(null);
outputTable.setDisplayName("Test");
CTTable outputCTTable = outputTable.getCTTable();
}
}
- @Test
- public void getNumberOfMappedColumns() throws IOException {
- try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("StructuredReferences.xlsx")) {
- XSSFTable table = wb.getTable("\\_Prime.1");
- //noinspection deprecation
- assertEquals(3, table.getNumberOfMappedColumns());
- }
- }
-
@Test
public void getColumnCount() throws IOException {
try (XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("StructuredReferences.xlsx")) {
// can be synchronized with the underlying CTTable
try (XSSFWorkbook wb = new XSSFWorkbook()) {
XSSFSheet sh = wb.createSheet();
- XSSFTable table = sh.createTable();
+ XSSFTable table = sh.createTable(null);
assertNotNull(table.getDisplayName());
assertNotNull(table.getCTTable().getDisplayName());
CTTable ctTable = table.getCTTable();
public void getRowCount() throws IOException {
try (XSSFWorkbook wb = new XSSFWorkbook()) {
XSSFSheet sh = wb.createSheet();
- XSSFTable table = sh.createTable();
+ XSSFTable table = sh.createTable(null);
CTTable ctTable = table.getCTTable();
assertEquals(0, table.getRowCount());
// If a table is added after getTable is called it should still be reachable by XSSFWorkbook.getTable
// This test makes sure that if any caching is done that getTable never uses a stale cache
- XSSFTable table2 = wb.getSheet("Foglio2").createTable();
+ XSSFTable table2 = wb.getSheet("Foglio2").createTable(null);
table2.setName("Table2");
assertSame("Did not find Table2", table2, wb.getTable("Table2"));
return dir;
}
- /**
- * Treats the directory as an embedded MAPIMessage (it normally is one), and
- * returns a MAPIMessage object to process it with.
- *
- * @deprecated use {@link #getAsEmbeddedMessage()} instead
- */
- @Removal(version = "4.3")
- @Deprecated
- public MAPIMessage getAsEmbededMessage() throws IOException {
- return getAsEmbeddedMessage();
- }
-
/**
* Treats the directory as an embedded MAPIMessage (it normally is one), and
* returns a MAPIMessage object to process it with.
import org.apache.poi.common.Duplicatable;
import org.apache.poi.hwpf.model.types.BKFAbstractType;
import org.apache.poi.util.Internal;
-import org.apache.poi.util.Removal;
@Internal
public final class BookmarkFirstDescriptor extends BKFAbstractType implements Duplicatable {
fillFields( data, offset );
}
- @Override
- @SuppressWarnings("squid:S2975")
- @Deprecated
- @Removal(version = "5.0.0")
- protected BookmarkFirstDescriptor clone() {
- return copy();
- }
-
@Override
public BookmarkFirstDescriptor copy() {
return new BookmarkFirstDescriptor(this);
if ( hasChp )
{
- SprmBuffer newSprmBuffer = sprmBuffer.clone();
+ SprmBuffer newSprmBuffer = sprmBuffer.copy();
CHPX chpx = new CHPX( textPiece.getStart(),
textPiece.getEnd(), newSprmBuffer );
import org.apache.poi.common.Duplicatable;
import org.apache.poi.util.Internal;
import org.apache.poi.util.LittleEndian;
-import org.apache.poi.util.Removal;
/**
* 24-bit color structure
this.value = value;
}
- @Override
- @SuppressWarnings("squid:S2975")
- @Deprecated
- @Removal(version = "5.0.0")
- public Colorref clone() {
- return copy();
- }
-
@Override
public Colorref copy() {
return new Colorref(this);
import org.apache.poi.common.Duplicatable;
import org.apache.poi.hwpf.model.types.FRDAbstractType;
import org.apache.poi.util.Internal;
-import org.apache.poi.util.Removal;
@Internal
public final class FootnoteReferenceDescriptor extends FRDAbstractType implements Duplicatable {
fillFields( data, offset );
}
- @Override
- @SuppressWarnings("squid:S2975")
- @Deprecated
- @Removal(version = "5.0.0")
- protected FootnoteReferenceDescriptor clone() {
- return copy();
- }
-
@Override
public FootnoteReferenceDescriptor copy() {
return new FootnoteReferenceDescriptor(this);
import org.apache.poi.hwpf.usermodel.CharacterProperties;
import org.apache.poi.util.Internal;
import org.apache.poi.util.LittleEndian;
-import org.apache.poi.util.Removal;
/**
* Hyphenation. Substructure of the {@link CharacterProperties}.
fillFields( data, 0 );
}
- @Override
- @SuppressWarnings("squid:S2975")
- @Deprecated
- @Removal(version = "5.0.0")
- public Hyphenation clone() {
- return copy();
- }
-
@Override
public Hyphenation copy() {
return new Hyphenation(this);
import org.apache.poi.common.Duplicatable;
import org.apache.poi.util.BitField;
import org.apache.poi.util.Internal;
-import org.apache.poi.util.Removal;
@Internal
public final class PropertyModifier implements Duplicatable {
value = other.value;
}
- @Override
- @SuppressWarnings("squid:S2975")
- @Deprecated
- @Removal(version = "5.0.0")
- protected PropertyModifier clone() {
- return copy();
- }
-
@Override
public PropertyModifier copy() {
return new PropertyModifier(this);
import org.apache.poi.util.Internal;
import org.apache.poi.util.POILogFactory;
import org.apache.poi.util.POILogger;
-import org.apache.poi.util.Removal;
/**
* Represents a lightweight node in the Trees used to store content
return false;
}
- @Override
- @Deprecated
- @Removal(version = "5.0.0")
- @SuppressWarnings({"unchecked","squid:S2975"})
- public T clone() {
- return (T) copy();
- }
-
@Override
public abstract PropertyNode<?> copy();
public static CharacterProperties uncompressCHP(
CharacterProperties parent, byte[] grpprl, int offset )
{
- CharacterProperties newProperties = parent.clone();
+ CharacterProperties newProperties = parent.copy();
applySprms( parent, grpprl, offset, true, newProperties );
return newProperties;
}
}
else
{
- newProperties = parStyle.clone();
+ newProperties = parStyle.copy();
}
/*
}
CharacterProperties styleProperties = newProperties;
- newProperties = styleProperties.clone();
+ newProperties = styleProperties.copy();
try
{
case 0x33:
// preserve the fSpec setting from the original CHP
boolean fSpec = newCHP.isFSpec();
- newCHP = oldCHP.clone();
+ newCHP = oldCHP.copy();
newCHP.setFSpec( fSpec );
return;
case 0x34:
import org.apache.poi.util.Internal;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.LittleEndianConsts;
-import org.apache.poi.util.Removal;
@Internal
public final class SprmBuffer implements Duplicatable {
_offset += grpprl.length - offset;
}
- @Override
- @SuppressWarnings("squid:S2975")
- @Deprecated
- @Removal(version = "5.0.0")
- public SprmBuffer clone() {
- return copy();
- }
-
@Override
public SprmBuffer copy() {
return new SprmBuffer(this);
import org.apache.poi.util.BitFieldFactory;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.LittleEndianConsts;
-import org.apache.poi.util.Removal;
/**
* Mapping class for BRC80 structure (Border Code for Word 97)
return 42; // any arbitrary constant will do
}
- @Override
- @SuppressWarnings("squid:S2975")
- @Deprecated
- @Removal(version = "5.0.0")
- public BorderCode clone() {
- return copy();
- }
-
@Override
public BorderCode copy() {
return new BorderCode(this);
import org.apache.poi.common.Duplicatable;
import org.apache.poi.hwpf.model.Colorref;
import org.apache.poi.hwpf.model.types.CHPAbstractType;
-import org.apache.poi.util.Removal;
@SuppressWarnings("unused")
public final class CharacterProperties extends CHPAbstractType implements Duplicatable {
setCv( new Colorref( colour24 & 0xFFFFFF ) );
}
- @Override
- @SuppressWarnings({"squid:S2975", "MethodDoesntCallSuperMethod"})
- @Deprecated
- @Removal(version = "5.0.0")
- public CharacterProperties clone() {
- return copy();
- }
-
@Override
public CharacterProperties copy() {
return new CharacterProperties(this);
import org.apache.poi.hwpf.model.NilPICFAndBinData;
import org.apache.poi.hwpf.model.StyleSheet;
import org.apache.poi.hwpf.sprm.SprmBuffer;
-import org.apache.poi.util.Removal;
import java.math.BigDecimal;
import java.math.RoundingMode;
_props.setIco24(colour24);
}
- /**
- * Used to create a deep copy of this object.
- *
- * @return A deep copy.
- */
- @Override
- @SuppressWarnings("squid:S2975")
- @Deprecated
- @Removal(version = "5.0.0")
- public CharacterRun clone() {
- return copy();
- }
-
@Override
public CharacterRun copy() {
return new CharacterRun(this);
package org.apache.poi.hwpf.usermodel;
-import java.util.Calendar;
-
import org.apache.poi.common.Duplicatable;
-import org.apache.poi.util.BitField;
-import org.apache.poi.util.BitFieldFactory;
-import org.apache.poi.util.LittleEndian;
-import org.apache.poi.util.LittleEndianConsts;
-import org.apache.poi.util.LocaleUtil;
-import org.apache.poi.util.Removal;
+import org.apache.poi.util.*;
+
+import java.util.Calendar;
/**
* This class is used to represent a date and time in a Word document.
private short _info;
private short _info2;
- public DateAndTime() {}
+ public DateAndTime() {
+ }
public DateAndTime(DateAndTime other) {
_info = other._info;
_info2 = LittleEndian.getShort(buf, offset + LittleEndianConsts.SHORT_SIZE);
}
- public Calendar getDate() {
- // TODO Discover if the timezone is stored somewhere else or not
- return LocaleUtil.getLocaleCalendar(
- _years.getValue(_info2)+1900,
- _months.getValue(_info2)-1,
- _dom.getValue(_info),
- _hours.getValue(_info),
- _minutes.getValue(_info),
- 0
- );
- }
-
- public void serialize(byte[] buf, int offset)
- {
- LittleEndian.putShort(buf, offset, _info);
- LittleEndian.putShort(buf, offset + LittleEndianConsts.SHORT_SIZE, _info2);
- }
-
- @Override
- public boolean equals(Object o)
- {
- if (!(o instanceof DateAndTime)) return false;
- DateAndTime dttm = (DateAndTime)o;
- return _info == dttm._info && _info2 == dttm._info2;
- }
-
- @Override
- public int hashCode() {
- assert false : "hashCode not designed";
- return 42; // any arbitrary constant will do
- }
+ public Calendar getDate() {
+ // TODO Discover if the timezone is stored somewhere else or not
+ return LocaleUtil.getLocaleCalendar(
+ _years.getValue(_info2) + 1900,
+ _months.getValue(_info2) - 1,
+ _dom.getValue(_info),
+ _hours.getValue(_info),
+ _minutes.getValue(_info),
+ 0
+ );
+ }
+
+ public void serialize(byte[] buf, int offset) {
+ LittleEndian.putShort(buf, offset, _info);
+ LittleEndian.putShort(buf, offset + LittleEndianConsts.SHORT_SIZE, _info2);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (!(o instanceof DateAndTime)) return false;
+ DateAndTime dttm = (DateAndTime) o;
+ return _info == dttm._info && _info2 == dttm._info2;
+ }
@Override
- @SuppressWarnings("squid:S2975")
- @Deprecated
- @Removal(version = "5.0.0")
- public DateAndTime clone() {
- return copy();
+ public int hashCode() {
+ assert false : "hashCode not designed";
+ return 42; // any arbitrary constant will do
}
+
@Override
public DateAndTime copy() {
return new DateAndTime(this);
}
- public boolean isEmpty()
- {
+ public boolean isEmpty() {
return _info == 0 && _info2 == 0;
}
@Override
- public String toString()
- {
- if ( isEmpty() )
+ public String toString() {
+ if (isEmpty())
return "[DTTM] EMPTY";
return "[DTTM] " + getDate();
import org.apache.poi.util.BitField;
import org.apache.poi.util.BitFieldFactory;
import org.apache.poi.util.LittleEndian;
-import org.apache.poi.util.Removal;
/**
* This data structure is used by a paragraph to determine how it should drop
this._fdct = fdct;
}
- @Override
- @SuppressWarnings("squid:S2975")
- @Deprecated
- @Removal(version = "5.0.0")
- public DropCapSpecifier clone() {
- return copy();
- }
-
@Override
public DropCapSpecifier copy() {
return new DropCapSpecifier(this);
import org.apache.poi.common.Duplicatable;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.util.LittleEndianConsts;
-import org.apache.poi.util.Removal;
/**
* This class is used to determine line spacing for a paragraph.
_fMultiLinespace = LittleEndian.getShort(buf, offset + LittleEndianConsts.SHORT_SIZE);
}
- @Override
- @SuppressWarnings("squid:S2975")
- @Deprecated
- @Removal(version = "5.0.0")
- public LineSpacingDescriptor clone() {
- return copy();
- }
-
@Override
public LineSpacingDescriptor copy() {
return new LineSpacingDescriptor(this);
import org.apache.poi.common.Duplicatable;
import org.apache.poi.hwpf.model.types.PAPAbstractType;
-import org.apache.poi.util.Removal;
@SuppressWarnings("unused")
public final class ParagraphProperties extends PAPAbstractType implements Duplicatable {
jcLogical = other.jcLogical;
}
- @Override
- @SuppressWarnings({"squid:S2975", "MethodDoesntCallSuperMethod"})
- @Deprecated
- @Removal(version = "5.0.0")
- public ParagraphProperties clone() {
- return copy();
- }
-
@Override
public ParagraphProperties copy() {
return new ParagraphProperties(this);
import org.apache.poi.common.Duplicatable;
import org.apache.poi.hwpf.HWPFOldDocument;
import org.apache.poi.hwpf.model.SEPX;
-import org.apache.poi.util.Removal;
public final class Section extends Range implements Duplicatable {
private final SectionProperties _props;
_props = sepx.getSectionProperties();
}
- @Override
- @SuppressWarnings({"squid:S2975", "MethodDoesntCallSuperMethod"})
- @Deprecated
- @Removal(version = "5.0.0")
- public Section clone() {
- return copy();
- }
-
@Override
public Section copy() {
return new Section(this);
import org.apache.poi.common.Duplicatable;
import org.apache.poi.hwpf.model.types.SEPAbstractType;
-import org.apache.poi.util.Removal;
public final class SectionProperties extends SEPAbstractType implements Duplicatable {
private short field_60_rncftn;
field_65_nfcednref = other.field_65_nfcednref;
}
- @Override
- @SuppressWarnings("squid:S2975")
- @Deprecated
- @Removal(version = "5.0.0")
- public SectionProperties clone() {
- return copy();
- }
-
@Override
public SectionProperties copy() {
return new SectionProperties(this);
import org.apache.poi.common.Duplicatable;
import org.apache.poi.hwpf.model.types.SHDAbstractType;
-import org.apache.poi.util.Removal;
/**
* The SHD is a substructure of the CHP, PAP, and TC for Word 2000.
fillFields( buf, offset );
}
- @Override
- @SuppressWarnings("squid:S2975")
- @Deprecated
- @Removal(version = "5.0.0")
- public ShadingDescriptor clone() {
- return copy();
- }
-
@Override
public ShadingDescriptor copy() {
return new ShadingDescriptor(this);
import org.apache.poi.common.Duplicatable;
import org.apache.poi.hwpf.model.Colorref;
import org.apache.poi.hwpf.model.types.SHD80AbstractType;
-import org.apache.poi.util.Removal;
/**
* The SHD80 is a substructure of the CHP and PAP, and TC for Word 97.
field_1_value = value;
}
- @Override
- @SuppressWarnings({"squid:S2975", "MethodDoesntCallSuperMethod"})
- @Deprecated
- @Removal(version = "5.0.0")
- public ShadingDescriptor80 clone() {
- return copy();
- }
-
@Override
public ShadingDescriptor80 copy() {
return new ShadingDescriptor80(this);
import org.apache.poi.common.Duplicatable;
import org.apache.poi.hwpf.model.types.TLPAbstractType;
-import org.apache.poi.util.Removal;
public class TableAutoformatLookSpecifier extends TLPAbstractType implements Duplicatable {
public static final int SIZE = 4;
fillFields( data, offset );
}
- @Override
- @SuppressWarnings({"squid:S2975", "MethodDoesntCallSuperMethod"})
- @Deprecated
- @Removal(version = "5.0.0")
- public TableAutoformatLookSpecifier clone() {
- return copy();
- }
-
@Override
public TableAutoformatLookSpecifier copy() {
return new TableAutoformatLookSpecifier(this);
import org.apache.poi.common.Duplicatable;
import org.apache.poi.hwpf.model.types.TCAbstractType;
import org.apache.poi.util.LittleEndian;
-import org.apache.poi.util.Removal;
public final class TableCellDescriptor extends TCAbstractType implements Duplicatable {
public static final int SIZE = 20;
getBrcRight().serialize(data, 0x10 + offset);
}
- @Override
- @SuppressWarnings({"squid:S2975", "MethodDoesntCallSuperMethod"})
- @Deprecated
- @Removal(version = "5.0.0")
- public TableCellDescriptor clone() {
- return copy();
- }
-
@Override
public TableCellDescriptor copy() {
return new TableCellDescriptor(this);
import org.apache.poi.common.Duplicatable;
import org.apache.poi.hwpf.model.types.TAPAbstractType;
-import org.apache.poi.util.Removal;
public final class TableProperties extends TAPAbstractType implements Duplicatable {
setRgdxaCenterPrint( new short[columns] );
}
- @Override
- @SuppressWarnings({"squid:S2975", "MethodDoesntCallSuperMethod"})
- @Deprecated
- @Removal(version = "5.0.0")
- public TableProperties clone() {
- return copy();
- }
-
@Override
public TableProperties copy() {
return new TableProperties(this);