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

public abstract Class AbstractEscherHolderRecord

extends Record
Class Inheritance
Known Direct Subclasses
org.apache.poi.hssf.record.DrawingGroupRecord, org.apache.poi.hssf.record.DrawingRecordForBiffViewer, org.apache.poi.hssf.record.EscherAggregate
Imports
java.util.ArrayList, .List, org.apache.poi.ddf.DefaultEscherRecordFactory, .EscherContainerRecord, .EscherRecord, .EscherRecordFactory, .NullEscherSerializationListener, org.apache.poi.hssf.util.LazilyConcatenatedByteArray, org.apache.poi.util.LittleEndian, .Removal

The escher container record is used to hold escher records. It is abstract and must be subclassed for maximum benefit.

Child records are deserialized on-demand unless the poi.deserialize.escher System Property is defined.

Field Summary

Modifier and TypeField and Description
private static boolean
private final List<EscherRecord>
private final LazilyConcatenatedByteArray

Constructor Summary

AccessConstructor and Description
public
public
public

Method Summary

Modifier and TypeMethod and Description
public void
addEscherRecord(int index, EscherRecord element)

public boolean
public void
protected void
convertRawBytesToEscherRecords()
Deprecated Call decode() instead.

private void
convertToEscherRecords(int offset, int size, byte[] data)

public abstract AbstractEscherHolderRecord
public void
decode()

Convert raw data to escher records.

public EscherRecord

Returns:

the record or null if it can't be found
findFirstWithId
(short
the record to look for
id
)

Descends into all our children, returning the first EscherRecord with the given id, or null if none found

private EscherRecord
findFirstWithId(short id, List<EscherRecord> records)

public EscherContainerRecord

Returns:

the EscherContainerRecord or null if no child is a container record
getEscherContainer
()

If we have a EscherContainerRecord as one of our children (and most top level escher holders do), then return that.

public EscherRecord
getEscherRecord(int index)

public List<EscherRecord>
public List<EscherRecord>
public byte[]
protected abstract String
public int
getRecordSize()

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

gives the current serialized size of the record.

public abstract short
getSid()

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

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

public void
join(AbstractEscherHolderRecord
the record data to concatenate to the end
record
)

Big drawing group records are split but it's easier to deal with them as a whole group so we need to join them together.

public void
processContinueRecord(byte[] record)

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.

public void
setRawData(byte[] rawData)

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

Field Detail

DESERIALIZEback to summary
private static boolean DESERIALIZE
escherRecordsback to summary
private final List<EscherRecord> escherRecords
rawDataContainerback to summary
private final LazilyConcatenatedByteArray rawDataContainer

Constructor Detail

AbstractEscherHolderRecordback to summary
public AbstractEscherHolderRecord()
AbstractEscherHolderRecordback to summary
public AbstractEscherHolderRecord(AbstractEscherHolderRecord other)
AbstractEscherHolderRecordback to summary
public AbstractEscherHolderRecord(RecordInputStream in)

Method Detail

addEscherRecordback to summary
public void addEscherRecord(int index, EscherRecord element)
addEscherRecordback to summary
public boolean addEscherRecord(EscherRecord element)
clearEscherRecordsback to summary
public void clearEscherRecords()
convertRawBytesToEscherRecordsback to summary
protected void convertRawBytesToEscherRecords()

Deprecated

Call decode() instead.

Annotations
@Removal
version:5.3
@Deprecated
convertToEscherRecordsback to summary
private void convertToEscherRecords(int offset, int size, byte[] data)
copyback to summary
public abstract AbstractEscherHolderRecord copy()

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

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

Returns:AbstractEscherHolderRecord

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

a deep copy of the implementing class / instance

Annotations
@Override
decodeback to summary
public void decode()

Convert raw data to escher records.

findFirstWithIdback to summary
public EscherRecord findFirstWithId(short id)

Descends into all our children, returning the first EscherRecord with the given id, or null if none found

Parameters
id:short

the record to look for

Returns:EscherRecord

the record or null if it can't be found

findFirstWithIdback to summary
private EscherRecord findFirstWithId(short id, List<EscherRecord> records)
getEscherContainerback to summary
public EscherContainerRecord getEscherContainer()

If we have a EscherContainerRecord as one of our children (and most top level escher holders do), then return that.

Returns:EscherContainerRecord

the EscherContainerRecord or null if no child is a container record

getEscherRecordback to summary
public EscherRecord getEscherRecord(int index)
getEscherRecordsback to summary
public List<EscherRecord> getEscherRecords()
getGenericChildrenback to summary
public List<EscherRecord> getGenericChildren()

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

Annotations
@Override
getRawDataback to summary
public byte[] getRawData()
getRecordNameback to summary
protected abstract String getRecordName()
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 abstract 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
joinback to summary
public void join(AbstractEscherHolderRecord record)

Big drawing group records are split but it's easier to deal with them as a whole group so we need to join them together.

Parameters
record:AbstractEscherHolderRecord

the record data to concatenate to the end

processContinueRecordback to summary
public void processContinueRecord(byte[] record)
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
setRawDataback to summary
public void setRawData(byte[] rawData)