import org.apache.poi.util.GenericRecordUtil;
import org.apache.poi.util.LittleEndian;
-import org.apache.poi.util.Removal;
/**
* Common abstract class for {@link EscherOptRecord} and
sortProperties();
}
- /**
- * @deprecated use {@link #removeEscherProperty(EscherPropertyTypes)} instead
- */
- @Deprecated
- @Removal(version = "5.0.0")
- public void removeEscherProperty(int num){
- properties.removeIf(prop -> prop.getPropertyNumber() == num);
- }
-
public void removeEscherProperty(EscherPropertyTypes type){
properties.removeIf(prop -> prop.getPropertyNumber() == type.propNumber);
}
*/
private final boolean emptyComplexPart;
- /**
- * Create an instance of an escher array property.
- * This constructor defaults to a 6 bytes header if the complexData is null or byte[0].
- *
- * @param id The id consists of the property number, a flag indicating whether this is a blip id and a flag
- * indicating that this is a complex property.
- * @param complexData The value of this property.
- *
- * @deprecated use {@link #EscherArrayProperty(EscherPropertyTypes, boolean, int)} and {@link #setComplexData(byte[])}
- */
- @Deprecated
- @Removal(version = "5.0.0")
- @Internal
- public EscherArrayProperty(short id, byte[] complexData) {
- this(id, safeSize(complexData == null ? 0 : complexData.length));
- setComplexData(complexData);
- }
-
/**
* Create an instance of an escher array property.
* This constructor can be used to create emptyComplexParts with a complexSize = 0.
import org.apache.poi.util.GenericRecordUtil;
import org.apache.poi.util.IOUtils;
import org.apache.poi.util.LittleEndian;
-import org.apache.poi.util.Removal;
/**
* A complex property differs from a simple property in that the data can not fit inside a 32 bit
private byte[] complexData;
- /**
- * Create a complex property using the property id and a byte array containing the complex
- * data value.
- *
- * @param id The id consists of the property number, a flag indicating whether this is a blip id and a flag
- * indicating that this is a complex property.
- * @param complexData The value of this property.
- *
- * @deprecated use {@link #EscherComplexProperty(short, int)} and {@link #setComplexData(byte[])} instead
- */
- @Deprecated
- @Removal(version = "5.0.0")
- public EscherComplexProperty(short id, byte[] complexData) {
- this(id, complexData == null ? 0 : complexData.length);
- setComplexData(complexData);
- }
-
- /**
- * Create a complex property using the property number, a flag to indicate whether this is a
- * blip reference and the complex property data.
- *
- * @param propertyNumber The property number
- * @param isBlipId Whether this is a blip id. Should be false.
- * @param complexData The value of this complex property.
- *
- * @deprecated use {@link #EscherComplexProperty(EscherPropertyTypes, boolean, int)} and {@link #setComplexData(byte[])} instead
- */
- @Deprecated
- @Removal(version = "5.0.0")
- public EscherComplexProperty(short propertyNumber, boolean isBlipId, byte[] complexData) {
- this(propertyNumber, isBlipId, complexData == null ? 0 : complexData.length);
- setComplexData(complexData);
- }
-
/**
* Create a complex property using the property id and a byte array containing the complex
* data value size.
import org.apache.poi.util.GenericRecordUtil;
import org.apache.poi.util.LittleEndianOutput;
-import org.apache.poi.util.Removal;
/**
* Specifies the maximum times the gui should perform a formula recalculation.
return sid;
}
- /**
- * @deprecated use {@link #copy()} instead
- */
- @SuppressWarnings({"squid:S2975", "MethodDoesntCallSuperMethod"})
- @Deprecated
- @Removal(version = "5.0.0")
- public CalcCountRecord clone() {
- return copy();
- }
-
@Override
public CalcCountRecord copy() {
return new CalcCountRecord(this);
import org.apache.poi.util.GenericRecordUtil;
import org.apache.poi.util.LittleEndianOutput;
-import org.apache.poi.util.Removal;
/**
* Tells the gui whether to calculate formulas automatically, manually or automatically except for tables.
return sid;
}
- /**
- * @deprecated use {@link #copy()} instead
- */
- @SuppressWarnings({"squid:S2975", "MethodDoesntCallSuperMethod"})
- @Deprecated
- @Removal(version = "5.0.0")
- public CalcModeRecord clone() {
- return copy();
- }
-
@Override
public CalcModeRecord copy() {
return new CalcModeRecord(this);
import org.apache.poi.util.GenericRecordUtil;
import org.apache.poi.util.LittleEndianOutput;
-import org.apache.poi.util.Removal;
/**
* Flag denoting whether the user specified that gridlines are used when printing.
return sid;
}
- /**
- * @deprecated use {@link #copy()} instead
- */
- @SuppressWarnings({"squid:S2975", "MethodDoesntCallSuperMethod"})
- @Deprecated
- @Removal(version = "5.0.0")
- public GridsetRecord clone() {
- return copy();
- }
-
@Override
public GridsetRecord copy() {
return new GridsetRecord(this);
import org.apache.poi.util.IOUtils;
import org.apache.poi.util.LittleEndianInput;
import org.apache.poi.util.LittleEndianOutput;
-import org.apache.poi.util.Removal;
/**
* ftGmo (0x0006)<p>
return sid;
}
- /**
- * @deprecated use {@link #copy()} instead
- */
- @SuppressWarnings("squid:S2975")
- @Deprecated
- @Removal(version = "5.0.0")
- public GroupMarkerSubRecord clone() {
- return copy();
- }
-
@Override
public GroupMarkerSubRecord copy() {
return new GroupMarkerSubRecord(this);
package org.apache.poi.hssf.record;
-import org.apache.poi.util.Removal;
-
/**
* HorizontalPageBreak (0x001B) record that stores page breaks at rows
*
return sid;
}
- /**
- * @deprecated use {@link #copy()} instead
- */
- @Override
- @SuppressWarnings({"squid:S2975", "MethodDoesntCallSuperMethod"})
- @Deprecated
- @Removal(version = "5.0.0")
- public PageBreakRecord clone() {
- return copy();
- }
-
@Override
public HorizontalPageBreakRecord copy() {
return new HorizontalPageBreakRecord(this);
import org.apache.poi.util.POILogFactory;
import org.apache.poi.util.POILogger;
import org.apache.poi.util.RecordFormatException;
-import org.apache.poi.util.Removal;
/**
* Label Record (0x0204) - read only support for strings stored directly in the cell...
* no op!
*/
@Override
- public void setXFIndex(short xf)
- {
- }
-
- /**
- * @deprecated use {@link #copy()} instead
- */
- @SuppressWarnings({"squid:S2975", "MethodDoesntCallSuperMethod"})
- @Deprecated
- @Removal(version = "5.0.0")
- public LabelRecord clone() {
- return copy();
- }
+ public void setXFIndex(short xf) {}
@Override
public LabelRecord copy() {
import org.apache.poi.util.LittleEndianInput;
import org.apache.poi.util.LittleEndianOutput;
import org.apache.poi.util.RecordFormatException;
-import org.apache.poi.util.Removal;
import org.apache.poi.util.StringUtil;
/**
}
}
- /**
- * @deprecated use {@link #copy()} instead
- */
- @SuppressWarnings("squid:S2975")
- @Deprecated
- @Removal(version = "5.0.0")
- public LbsDataSubRecord clone() {
- return copy();
- }
-
@Override
public LbsDataSubRecord copy() {
return new LbsDataSubRecord(this);
import org.apache.poi.util.LittleEndianInput;
import org.apache.poi.util.LittleEndianOutput;
import org.apache.poi.util.RecordFormatException;
-import org.apache.poi.util.Removal;
/**
* ftNts (0x000D)<p>
return sid;
}
- /**
- * @deprecated use {@link #copy()} instead
- */
- @SuppressWarnings("squid:S2975")
- @Deprecated
- @Removal(version = "5.0.0")
- public NoteStructureSubRecord clone() {
- return copy();
- }
-
@Override
public NoteStructureSubRecord copy() {
return new NoteStructureSubRecord(this);
import org.apache.poi.util.LittleEndianByteArrayInputStream;
import org.apache.poi.util.LittleEndianByteArrayOutputStream;
import org.apache.poi.util.RecordFormatException;
-import org.apache.poi.util.Removal;
/**
* OBJRECORD (0x005D)<p>
return subrecords.add(o);
}
- /**
- * @deprecated use {@link #copy()} instead
- */
- @SuppressWarnings({"squid:S2975", "MethodDoesntCallSuperMethod"})
- @Deprecated
- @Removal(version = "5.0.0")
- public ObjRecord clone() {
- return copy();
- }
-
@Override
public ObjRecord copy() {
return new ObjRecord(this);
import org.apache.poi.util.GenericRecordUtil;
import org.apache.poi.util.LittleEndianOutput;
-import org.apache.poi.util.Removal;
/**
* Describes the frozen and unfrozen panes.
return sid;
}
- /**
- * @deprecated use {@link #copy()} instead
- */
- @SuppressWarnings({"squid:S2975", "MethodDoesntCallSuperMethod"})
- @Deprecated
- @Removal(version = "5.0.0")
- public PaneRecord clone() {
- return copy();
- }
-
@Override
public PaneRecord copy() {
return new PaneRecord(this);
import org.apache.poi.util.GenericRecordUtil;
import org.apache.poi.util.LittleEndianOutput;
-import org.apache.poi.util.Removal;
/**
* Whether or not to print the row/column headers when you enjoy your spreadsheet in the physical form.
return sid;
}
- /**
- * @deprecated use {@link #copy()} instead
- */
- @SuppressWarnings({"squid:S2975", "MethodDoesntCallSuperMethod"})
- @Deprecated
- @Removal(version = "5.0.0")
- public PrintHeadersRecord clone() {
- return copy();
- }
-
public PrintHeadersRecord copy() {
return new PrintHeadersRecord(this);
}
import org.apache.poi.util.BitField;
import org.apache.poi.util.BitFieldFactory;
import org.apache.poi.util.LittleEndianOutput;
-import org.apache.poi.util.Removal;
/**
* Stores print setup options -- bogus for HSSF (and marked as such)
return sid;
}
- /**
- * @deprecated use {@link #copy()} instead
- */
- @SuppressWarnings({"squid:S2975", "MethodDoesntCallSuperMethod"})
- @Deprecated
- @Removal(version = "5.0.0")
- public PrintSetupRecord clone() {
- return copy();
- }
-
@Override
public PrintSetupRecord copy() {
return new PrintSetupRecord(this);
import org.apache.poi.util.GenericRecordUtil;
import org.apache.poi.util.LittleEndianOutput;
-import org.apache.poi.util.Removal;
/**
* Record for the right margin.
public void setMargin( double field_1_margin )
{ this.field_1_margin = field_1_margin; }
- /**
- * @deprecated use {@link #copy()} instead
- */
- @SuppressWarnings({"squid:S2975", "MethodDoesntCallSuperMethod"})
- @Deprecated
- @Removal(version = "5.0.0")
- public RightMarginRecord clone() {
- return copy();
- }
-
public RightMarginRecord copy() {
return new RightMarginRecord(this);
}
import org.apache.poi.hssf.record.cont.ContinuableRecord;
import org.apache.poi.hssf.record.cont.ContinuableRecordOutput;
import org.apache.poi.util.GenericRecordUtil;
-import org.apache.poi.util.Removal;
import org.apache.poi.util.StringUtil;
/**
_is16bitUnicode = StringUtil.hasMultibyte(string);
}
- /**
- * @deprecated use {@link #copy()} instead
- */
- @SuppressWarnings({"squid:S2975", "MethodDoesntCallSuperMethod"})
- @Deprecated
- @Removal(version = "5.0.0")
- public StringRecord clone() {
- return copy();
- }
-
public StringRecord copy() {
return new StringRecord(this);
}
import org.apache.poi.util.BitField;
import org.apache.poi.util.BitFieldFactory;
import org.apache.poi.util.RecordFormatException;
-import org.apache.poi.util.Removal;
/**
* The TXO record (0x01B6) is used to define the properties of a text box. It is
return _linkRefPtg;
}
- /**
- * @deprecated use {@link #copy()} instead
- */
- @Override
- @SuppressWarnings({"squid:S2975", "MethodDoesntCallSuperMethod"})
- @Deprecated
- @Removal(version = "5.0.0")
- public TextObjectRecord clone() {
- return copy();
- }
-
@Override
public TextObjectRecord copy() {
return new TextObjectRecord(this);
package org.apache.poi.hssf.record;
-import org.apache.poi.util.Removal;
-
/**
* VerticalPageBreak (0x001A) record that stores page breaks at columns
*
return sid;
}
- /**
- * @deprecated use {@link #copy()} instead
- */
- @Override
- @SuppressWarnings({"squid:S2975", "MethodDoesntCallSuperMethod"})
- @Deprecated
- @Removal(version = "5.0.0")
- public VerticalPageBreakRecord clone() {
- return copy();
- }
-
@Override
public VerticalPageBreakRecord copy() {
return new VerticalPageBreakRecord(this);
import java.util.zip.Checksum;
import org.apache.poi.EmptyFileException;
-import org.apache.poi.POIDocument;
-import org.apache.poi.ss.usermodel.Workbook;
-
@Internal
public final class IOUtils {
}
}
- /**
- * Write a POI Document ({@link org.apache.poi.ss.usermodel.Workbook}, {@link org.apache.poi.sl.usermodel.SlideShow}, etc) to an output stream and close the output stream.
- * This will attempt to close the output stream at the end even if there was a problem writing the document to the stream.
- *
- * If you are using Java 7 or higher, you may prefer to use a try-with-resources statement instead.
- * This function exists for Java 6 code.
- *
- * @param doc a writeable document to write to the output stream
- * @param out the output stream that the document is written to
- * @throws IOException thrown on errors writing to the stream
- *
- * @deprecated since 4.0, use try-with-resources, will be removed in 4.2
- */
- @Deprecated
- @Removal(version="4.2")
- public static void write(POIDocument doc, OutputStream out) throws IOException {
- try {
- doc.write(out);
- } finally {
- closeQuietly(out);
- }
- }
-
- /**
- * Write a ({@link org.apache.poi.ss.usermodel.Workbook}) to an output stream and close the output stream.
- * This will attempt to close the output stream at the end even if there was a problem writing the document to the stream.
- *
- * If you are using Java 7 or higher, you may prefer to use a try-with-resources statement instead.
- * This function exists for Java 6 code.
- *
- * @param doc a writeable document to write to the output stream
- * @param out the output stream that the document is written to
- * @throws IOException thrown on errors writing to the stream
- *
- * @deprecated since 4.0, use try-with-resources, will be removed in 4.2
- */
- @Deprecated
- @Removal(version="4.2")
- public static void write(Workbook doc, OutputStream out) throws IOException {
- try {
- doc.write(out);
- } finally {
- closeQuietly(out);
- }
- }
-
- /**
- * Write a POI Document ({@link org.apache.poi.ss.usermodel.Workbook}, {@link org.apache.poi.sl.usermodel.SlideShow}, etc) to an output stream and close the output stream.
- * This will attempt to close the output stream at the end even if there was a problem writing the document to the stream.
- * This will also attempt to close the document, even if an error occurred while writing the document or closing the output stream.
- *
- * If you are using Java 7 or higher, you may prefer to use a try-with-resources statement instead.
- * This function exists for Java 6 code.
- *
- * @param doc a writeable and closeable document to write to the output stream, then close
- * @param out the output stream that the document is written to
- * @throws IOException thrown on errors writing to the stream
- *
- * @deprecated since 4.0, use try-with-resources, will be removed in 4.2
- */
- @Deprecated
- @Removal(version="4.2")
- public static void writeAndClose(POIDocument doc, OutputStream out) throws IOException {
- try {
- write(doc, out);
- } finally {
- closeQuietly(doc);
- }
- }
-
- /**
- * Like {@link #writeAndClose(POIDocument, OutputStream)}, but for writing to a File instead of an OutputStream.
- * This will attempt to close the document, even if an error occurred while writing the document.
- *
- * If you are using Java 7 or higher, you may prefer to use a try-with-resources statement instead.
- * This function exists for Java 6 code.
- *
- * @param doc a writeable and closeable document to write to the output file, then close
- * @param out the output file that the document is written to
- * @throws IOException thrown on errors writing to the stream
- *
- * @deprecated since 4.0, use try-with-resources, will be removed in 4.2
- */
- @Deprecated
- @Removal(version="4.2")
- public static void writeAndClose(POIDocument doc, File out) throws IOException {
- try {
- doc.write(out);
- } finally {
- closeQuietly(doc);
- }
- }
-
- /**
- * Like {@link #writeAndClose(POIDocument, File)}, but for writing a POI Document in place (to the same file that it was opened from).
- * This will attempt to close the document, even if an error occurred while writing the document.
- *
- * If you are using Java 7 or higher, you may prefer to use a try-with-resources statement instead.
- * This function exists for Java 6 code.
- *
- * @param doc a writeable document to write in-place
- * @throws IOException thrown on errors writing to the file
- *
- * @deprecated since 4.0, use try-with-resources, will be removed in 4.2
- */
- @Deprecated
- @Removal(version="4.2")
- public static void writeAndClose(POIDocument doc) throws IOException {
- try {
- doc.write();
- } finally {
- closeQuietly(doc);
- }
- }
-
- // Since the Workbook interface doesn't derive from POIDocument
- // We'll likely need one of these for each document container interface
- /**
- *
- * @deprecated since 4.0, use try-with-resources, will be removed in 4.2
- */
- @Deprecated
- @Removal(version="4.2")
- public static void writeAndClose(Workbook doc, OutputStream out) throws IOException {
- try {
- doc.write(out);
- } finally {
- closeQuietly(doc);
- }
- }
-
/**
* Copies all the data from the given InputStream to the OutputStream. It
* leaves both streams open, so you will still need to close them once done.