Top Description Fields Constructors Methods
org.apache.poi.hssf.record

public final Class ObjRecord

extends Record
Class Inheritance
Imports
java.io.IOException, java.util.ArrayList, .List, .Map, java.util.function.Supplier, org.apache.poi.util.GenericRecordUtil, .HexDump, .LittleEndian, .LittleEndianByteArrayInputStream, .LittleEndianByteArrayOutputStream, .RecordFormatException

OBJRECORD (0x005D)

The obj record is used to hold various graphic objects and controls.

Field Summary

Modifier and TypeField and Description
private boolean
_isPaddedToQuadByteMultiple

Excel seems to tolerate padding to quad or double byte length

private final byte[]
_uninterpretedData

used when POI has no idea what is going on

private static int
private static final int
public static final short
private final List<SubRecord>

Constructor Summary

AccessConstructor and Description
public
public
public

Method Summary

Modifier and TypeMethod and Description
public void
addSubRecord(int index, SubRecord element)

public boolean
private static boolean
canPaddingBeDiscarded(byte[] data, int nRemainingBytes)

Some XLS files have ObjRecords with nearly 8Kb of excessive padding.

public void
public ObjRecord
public List<SubRecord>
public Map<String, Supplier<?>>
public HSSFRecordTypes
public int
getRecordSize()

Implements abstract org.apache.poi.hssf.record.RecordBase.getRecordSize.

gives the current serialized size of the record.

public short
getSid()

Implements abstract org.apache.poi.hssf.record.Record.getSid.

return the non static version of the id for this record.

public List<SubRecord>
public int
serialize(int
to begin writing at
offset
,
byte[]
byte array containing instance data
data
)

Implements abstract org.apache.poi.hssf.record.RecordBase.serialize.

called by the class that is responsible for writing this sucker.

Inherited from org.apache.poi.hssf.record.Record:
cloneViaReserialiseserializetoString

Field Detail

_isPaddedToQuadByteMultipleback to summary
private boolean _isPaddedToQuadByteMultiple

Excel seems to tolerate padding to quad or double byte length

_uninterpretedDataback to summary
private final byte[] _uninterpretedData

used when POI has no idea what is going on

MAX_PAD_ALIGNMENTback to summary
private static int MAX_PAD_ALIGNMENT
NORMAL_PAD_ALIGNMENTback to summary
private static final int NORMAL_PAD_ALIGNMENT
sidback to summary
public static final short sid
subrecordsback to summary
private final List<SubRecord> subrecords

Constructor Detail

ObjRecordback to summary
public ObjRecord()
ObjRecordback to summary
public ObjRecord(ObjRecord other)
ObjRecordback to summary
public ObjRecord(RecordInputStream in)

Method Detail

addSubRecordback to summary
public void addSubRecord(int index, SubRecord element)
addSubRecordback to summary
public boolean addSubRecord(SubRecord o)
canPaddingBeDiscardedback to summary
private static boolean canPaddingBeDiscarded(byte[] data, int nRemainingBytes)

Some XLS files have ObjRecords with nearly 8Kb of excessive padding. These were probably written by a version of POI (around 3.1) which incorrectly interpreted the second short of the ftLbs subrecord (0x1FEE) as a length, and read that many bytes as padding (other bugs helped allow this to occur). Excel reads files with this excessive padding OK, truncating the over-sized ObjRecord back to the its proper size. POI does the same.

clearSubRecordsback to summary
public void clearSubRecords()
copyback to summary
public ObjRecord copy()

Implements abstract org.apache.poi.hssf.record.Record.copy.

Implements org.apache.poi.common.Duplicatable.copy.

Returns:ObjRecord

Doc from org.apache.poi.common.Duplicatable.copy.

a deep copy of the implementing class / instance

Annotations
@Override
getGenericChildrenback to summary
public List<SubRecord> getGenericChildren()

Overrides default org.apache.poi.common.usermodel.GenericRecord.getGenericChildren.

Annotations
@Override
getGenericPropertiesback to summary
public Map<String, Supplier<?>> getGenericProperties()

Implements org.apache.poi.common.usermodel.GenericRecord.getGenericProperties.

Annotations
@Override
getGenericRecordTypeback to summary
public HSSFRecordTypes getGenericRecordType()

Overrides default org.apache.poi.common.usermodel.GenericRecord.getGenericRecordType.

Implements abstract org.apache.poi.hssf.record.Record.getGenericRecordType.

Annotations
@Override
getRecordSizeback to summary
public int getRecordSize()

Implements abstract org.apache.poi.hssf.record.RecordBase.getRecordSize.

Doc from org.apache.poi.hssf.record.RecordBase.getRecordSize.

gives the current serialized size of the record. Should include the sid and reclength (4 bytes).

Returns:int

the record size

Annotations
@Override
getSidback to summary
public short getSid()

Implements abstract org.apache.poi.hssf.record.Record.getSid.

Doc from org.apache.poi.hssf.record.Record.getSid.

return the non static version of the id for this record.

Returns:short

he id for this record

Annotations
@Override
getSubRecordsback to summary
public List<SubRecord> getSubRecords()
serializeback to summary
public int serialize(int offset, byte[] data)

Implements abstract org.apache.poi.hssf.record.RecordBase.serialize.

Doc from org.apache.poi.hssf.record.RecordBase.serialize.

called by the class that is responsible for writing this sucker. Subclasses should implement this so that their data is passed back in a byte array.

Parameters
offset:int

to begin writing at

data:byte[]

byte array containing instance data

Returns:int

number of bytes written

Annotations
@Override