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

public abstract Class SubRecord

extends Object
implements Duplicatable, GenericRecord
Class Inheritance
All Implemented Interfaces
org.apache.poi.common.usermodel.GenericRecord, org.apache.poi.common.Duplicatable
Known Direct Subclasses
org.apache.poi.hssf.record.SubRecord.UnknownSubRecord, org.apache.poi.hssf.record.CommonObjectDataSubRecord, org.apache.poi.hssf.record.EmbeddedObjectRefSubRecord, org.apache.poi.hssf.record.EndSubRecord, org.apache.poi.hssf.record.FtCblsSubRecord, org.apache.poi.hssf.record.FtCfSubRecord, org.apache.poi.hssf.record.FtPioGrbitSubRecord, org.apache.poi.hssf.record.GroupMarkerSubRecord, org.apache.poi.hssf.record.LbsDataSubRecord, org.apache.poi.hssf.record.NoteStructureSubRecord
Imports
java.util.Arrays, .Map, java.util.function.Function, .Supplier, java.util.stream.Collectors, org.apache.commons.io.output.UnsynchronizedByteArrayOutputStream, org.apache.poi.common.Duplicatable, org.apache.poi.common.usermodel.GenericRecord, org.apache.poi.util.GenericRecordJsonWriter, .GenericRecordUtil, .IOUtils, .LittleEndianInput, .LittleEndianOutput, .LittleEndianOutputStream

Subrecords are part of the OBJ class.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
private static class

Field Summary

Modifier and TypeField and Description
private static final int
private static int

Constructor Summary

AccessConstructor and Description
protected
protected

Method Summary

Modifier and TypeMethod and Description
public abstract SubRecord
public static SubRecord

Returns:

the created sub-record
createSubRecord
(LittleEndianInput
the stream to read from
in
,
int
the objectType field of the containing CommonObjectDataSubRecord, we need it to propagate to next sub-records as it defines what data follows
cmoOt
)

read a sub-record from the supplied stream

protected abstract int

Returns:

the size of the data for this record (which is always 4 bytes less than the total record size). Note however, that ushort encoded after the record sid is usually but not always the data size.
getDataSize
()

public abstract SubRecord.SubRecordTypes
public static int

Returns:

the max record length allowed for SubRecord
getMaxRecordLength
()

public boolean

Returns:

whether this record is the last in the sub-record stream
isTerminating
()

Whether this record terminates the sub-record stream.

public byte[]
public abstract void
public static void
setMaxRecordLength(int
the max record length allowed for SubRecord
length
)

public final String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

DEFAULT_MAX_RECORD_LENGTHback to summary
private static final int DEFAULT_MAX_RECORD_LENGTH
MAX_RECORD_LENGTHback to summary
private static int MAX_RECORD_LENGTH

Constructor Detail

SubRecordback to summary
protected SubRecord()
SubRecordback to summary
protected SubRecord(SubRecord other)

Method Detail

copyback to summary
public abstract SubRecord copy()

Redeclares org.apache.poi.common.Duplicatable.copy.

Returns:SubRecord

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

a deep copy of the implementing class / instance

Annotations
@Override
createSubRecordback to summary
public static SubRecord createSubRecord(LittleEndianInput in, int cmoOt)

read a sub-record from the supplied stream

Parameters
in:LittleEndianInput

the stream to read from

cmoOt:int

the objectType field of the containing CommonObjectDataSubRecord, we need it to propagate to next sub-records as it defines what data follows

Returns:SubRecord

the created sub-record

getDataSizeback to summary
protected abstract int getDataSize()
Returns:int

the size of the data for this record (which is always 4 bytes less than the total record size). Note however, that ushort encoded after the record sid is usually but not always the data size.

getGenericRecordTypeback to summary
public abstract SubRecord.SubRecordTypes getGenericRecordType()

Redeclares as abstract: org.apache.poi.common.usermodel.GenericRecord.getGenericRecordType.

Annotations
@Override
getMaxRecordLengthback to summary
public static int getMaxRecordLength()
Returns:int

the max record length allowed for SubRecord

isTerminatingback to summary
public boolean isTerminating()

Whether this record terminates the sub-record stream. There are two cases when this method must be overridden and return true - EndSubRecord (sid = 0x00) - LbsDataSubRecord (sid = 0x12)

Returns:boolean

whether this record is the last in the sub-record stream

serializeback to summary
public byte[] serialize()
serializeback to summary
public abstract void serialize(LittleEndianOutput out)
setMaxRecordLengthback to summary
public static void setMaxRecordLength(int length)
Parameters
length:int

the max record length allowed for SubRecord

toStringback to summary
public final String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
org.apache.poi.hssf.record back to summary

public final Enum SubRecord.SubRecordTypes

extends Enum<SubRecord.SubRecordTypes>
Class Inheritance

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface

Field Summary

Modifier and TypeField and Description
public static final SubRecord.SubRecordTypes
public static final SubRecord.SubRecordTypes
public static final SubRecord.SubRecordTypes
public static final SubRecord.SubRecordTypes
public static final SubRecord.SubRecordTypes
public static final SubRecord.SubRecordTypes
public static final SubRecord.SubRecordTypes
public static final SubRecord.SubRecordTypes
private static final Map<Short, SubRecord.SubRecordTypes>
public static final SubRecord.SubRecordTypes
public final SubRecord.SubRecordTypes.RecordConstructor<?>
public final short
public static final SubRecord.SubRecordTypes

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static SubRecord.SubRecordTypes
forSID(int sid)

public short
public static SubRecord.SubRecordTypes
public static SubRecord.SubRecordTypes[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

COMMON_OBJECT_DATAback to summary
public static final SubRecord.SubRecordTypes COMMON_OBJECT_DATA
EMBEDDED_OBJECT_REFback to summary
public static final SubRecord.SubRecordTypes EMBEDDED_OBJECT_REF
ENDback to summary
public static final SubRecord.SubRecordTypes END
FT_CBLSback to summary
public static final SubRecord.SubRecordTypes FT_CBLS
FT_CFback to summary
public static final SubRecord.SubRecordTypes FT_CF
FT_PIO_GRBITback to summary
public static final SubRecord.SubRecordTypes FT_PIO_GRBIT
GROUP_MARKERback to summary
public static final SubRecord.SubRecordTypes GROUP_MARKER
LBS_DATAback to summary
public static final SubRecord.SubRecordTypes LBS_DATA
LOOKUPback to summary
private static final Map<Short, SubRecord.SubRecordTypes> LOOKUP
NOTE_STRUCTUREback to summary
public static final SubRecord.SubRecordTypes NOTE_STRUCTURE
recordConstructorback to summary
public final SubRecord.SubRecordTypes.RecordConstructor<?> recordConstructor
sidback to summary
public final short sid
UNKNOWNback to summary
public static final SubRecord.SubRecordTypes UNKNOWN

Constructor Detail

SubRecordTypesback to summary
private SubRecordTypes(int sid, SubRecord.SubRecordTypes.RecordConstructor<?> recordConstructor)

Method Detail

forSIDback to summary
public static SubRecord.SubRecordTypes forSID(int sid)
getSidback to summary
public short getSid()
valueOfback to summary
public static SubRecord.SubRecordTypes valueOf(String name)
valuesback to summary
public static SubRecord.SubRecordTypes[] values()
org.apache.poi.hssf.record back to summary

public Interface SubRecord.SubRecordTypes.RecordConstructor<T extends SubRecord>

Annotations
@FunctionalInterface

Method Summary

Modifier and TypeMethod and Description
public T

Returns:

the created sub-record
apply
(LittleEndianInput
the stream to read from
in
,
int size, int
the objectType field of the containing CommonObjectDataSubRecord, we need it to propagate to next sub-records as it defines what data follows
cmoOt
)

read a sub-record from the supplied stream

Method Detail

applyback to summary
public T apply(LittleEndianInput in, int size, int cmoOt)

read a sub-record from the supplied stream

Parameters
in:LittleEndianInput

the stream to read from

cmoOt:int

the objectType field of the containing CommonObjectDataSubRecord, we need it to propagate to next sub-records as it defines what data follows

Returns:T

the created sub-record

org.apache.poi.hssf.record back to summary

private final Class SubRecord.UnknownSubRecord

extends SubRecord
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final byte[]
private final int

Constructor Summary

AccessConstructor and Description
public
UnknownSubRecord(LittleEndianInput in, int size, int sid)

Method Summary

Modifier and TypeMethod and Description
public SubRecord.UnknownSubRecord
protected int
public Map<String, Supplier<?>>
public SubRecord.SubRecordTypes
public void
Inherited from org.apache.poi.hssf.record.SubRecord:
createSubRecordgetMaxRecordLengthisTerminatingserializesetMaxRecordLengthtoString

Field Detail

_databack to summary
private final byte[] _data
_sidback to summary
private final int _sid

Constructor Detail

UnknownSubRecordback to summary
public UnknownSubRecord(LittleEndianInput in, int size, int sid)

Method Detail

copyback to summary
public SubRecord.UnknownSubRecord copy()

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

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

Returns:SubRecord.UnknownSubRecord

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

a deep copy of the implementing class / instance

Annotations
@Override
getDataSizeback to summary
protected int getDataSize()

Implements abstract org.apache.poi.hssf.record.SubRecord.getDataSize.

Returns:int

Doc from org.apache.poi.hssf.record.SubRecord.getDataSize.

the size of the data for this record (which is always 4 bytes less than the total record size). Note however, that ushort encoded after the record sid is usually but not always the data size.

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

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

Annotations
@Override
getGenericRecordTypeback to summary
public SubRecord.SubRecordTypes getGenericRecordType()

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

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

Annotations
@Override
serializeback to summary
public void serialize(LittleEndianOutput out)

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

Annotations
@Override