Top Description Fields Constructors Methods
org.apache.poi.ddf

public final Class EscherContainerRecord

extends EscherRecord
implements Iterable<EscherRecord>
Class Inheritance
All Implemented Interfaces
java.lang.Iterable
Imports
java.io.PrintWriter, java.util.ArrayList, .Collections, .Iterator, .List, .Map, .Spliterator, java.util.function.Supplier, org.apache.logging.log4j.LogManager, .Logger, org.apache.poi.util.GenericRecordUtil, .HexDump, .LittleEndian

Escher container records store other escher records as children. The container records themselves never store any information beyond the standard header used by all escher records. This one record is used to represent many different types of records.

Field Summary

Modifier and TypeField and Description
private final List<EscherRecord>
private int
_remainingLength

in case if document contains any charts we have such document structure: BOF ...

public static final short
public static final short
public static final short
private static final Logger
private static final int
public static final short
public static final short
public static final short

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public void
addChildBefore(EscherRecord
the record to be added
record
,
int
the recordId of the next sibling
insertBeforeRecordId
)

Add a child record before the record with given recordId

public void
addChildRecord(EscherRecord
the record to be added
record
)

Append a child record

public EscherContainerRecord
public void
display(PrintWriter
The print writer to output to.
w
,
int
The current indent level.
indent
)

Overrides org.apache.poi.ddf.EscherRecord.display.

The display methods allows escher variables to print the record names according to their hierarchy.

public int
fillFields(byte[]
The byte array containing the serialized escher records.
data
,
int
The offset into the byte array.
pOffset
,
EscherRecordFactory
A factory for creating new escher records.
recordFactory
)

Implements abstract org.apache.poi.ddf.EscherRecord.fillFields.

The contract of this method is to deserialize an escher record including its children.

pack-priv int
fillFields(byte[] data, int pOffset, EscherRecordFactory recordFactory, int nesting)

public EscherRecord
getChild(int
the index of the child within the child records
index
)

Overrides org.apache.poi.ddf.EscherRecord.getChild.

Returns the indexed child record.

public <T extends EscherRecord> T
getChildById(short recordId)

public List<EscherContainerRecord>

Returns:

EscherContainer children
getChildContainers
()

Returns all of our children which are also EscherContainers (may be 0, 1, or vary rarely 2 or 3)

public int
public List<EscherRecord>

Returns:

a copy of the list of all the child records of the container.
getChildRecords
()

Overrides org.apache.poi.ddf.EscherRecord.getChildRecords.

public Map<String, Supplier<?>>
public Enum<E extends Enum<E>>
public String
getRecordName()

Implements abstract org.apache.poi.ddf.EscherRecord.getRecordName.

Subclasses should return the short name for this escher record.

public void
getRecordsById(short
the recordId to be searched for
recordId
,
List<EscherRecord>
- list to store found records
out
)

Recursively find records with the specified record ID

public int
getRecordSize()

Implements abstract org.apache.poi.ddf.EscherRecord.getRecordSize.

Subclasses should effeciently return the number of bytes required to serialize the record.

public boolean

Returns:

true, if any child has the given recordId
hasChildOfType
(short
the recordId of the child
recordId
)

Do any of our (top level) children have the given recordId?

public Iterator<EscherRecord>

Returns:

an iterator over the child records
iterator
()

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

public boolean

Returns:

true, if the record was found and removed
removeChildRecord
(EscherRecord
the escher record to be removed
toBeRemoved
)

Removes the given escher record from the child list

public int
serialize(int
the offset within the byte array
offset
,
byte[]
the data array to serialize to
data
,
EscherSerializationListener
a listener for begin and end serialization events. This is useful because the serialization is hierarchical/recursive and sometimes you need to be able break into that.
listener
)

Implements abstract org.apache.poi.ddf.EscherRecord.serialize.

Serializes the record to an existing byte array.

public void
setChildRecords(List<EscherRecord>
Not used in base implementation.
childRecords
)

Overrides org.apache.poi.ddf.EscherRecord.setChildRecords.

replaces the internal child list with the contents of the supplied childRecords

public Spliterator<EscherRecord>

Returns:

a spliterator over the child records
spliterator
()

Overrides default java.lang.Iterable.spliterator.

Creates a Spliterator over the elements described by this Iterable.

Inherited from org.apache.poi.ddf.EscherRecord:
fillFieldsgetGenericChildrengetInstancegetOptionsgetRecordIdgetVersionisContainerRecordreadHeaderreadInstanceserializeserializesetInstancesetOptionssetRecordIdsetVersiontoStringtoXmltoXml

Field Detail

_childRecordsback to summary
private final List<EscherRecord> _childRecords
_remainingLengthback to summary
private int _remainingLength

in case if document contains any charts we have such document structure: BOF ... DrawingRecord ... ObjRecord|TxtObjRecord ... EOF ... BOF(Chart begin) ... DrawingRecord ... ObjRecord|TxtObjRecord ... EOF So, when we call EscherAggregate.createAggregate() we have not all needed data. When we got warning "WARNING: " + bytesRemaining + " bytes remaining but no space left" we should save value of bytesRemaining and add it to container size when we serialize it

BSTORE_CONTAINERback to summary
public static final short BSTORE_CONTAINER
DG_CONTAINERback to summary
public static final short DG_CONTAINER
DGG_CONTAINERback to summary
public static final short DGG_CONTAINER
LOGGERback to summary
private static final Logger LOGGER
MAX_NESTED_CHILD_NODESback to summary
private static final int MAX_NESTED_CHILD_NODES
SOLVER_CONTAINERback to summary
public static final short SOLVER_CONTAINER
SP_CONTAINERback to summary
public static final short SP_CONTAINER
SPGR_CONTAINERback to summary
public static final short SPGR_CONTAINER

Constructor Detail

EscherContainerRecordback to summary
public EscherContainerRecord()
EscherContainerRecordback to summary
public EscherContainerRecord(EscherContainerRecord other)

Method Detail

addChildBeforeback to summary
public void addChildBefore(EscherRecord record, int insertBeforeRecordId)

Add a child record before the record with given recordId

Parameters
record:EscherRecord

the record to be added

insertBeforeRecordId:int

the recordId of the next sibling

addChildRecordback to summary
public void addChildRecord(EscherRecord record)

Append a child record

Parameters
record:EscherRecord

the record to be added

copyback to summary
public EscherContainerRecord copy()

Implements abstract org.apache.poi.ddf.EscherRecord.copy.

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

Returns:EscherContainerRecord

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

a deep copy of the implementing class / instance

Annotations
@Override
displayback to summary
public void display(PrintWriter w, int indent)

Overrides org.apache.poi.ddf.EscherRecord.display.

Doc from org.apache.poi.ddf.EscherRecord.display.

The display methods allows escher variables to print the record names according to their hierarchy.

Parameters
w:PrintWriter

The print writer to output to.

indent:int

The current indent level.

Annotations
@Override
fillFieldsback to summary
public int fillFields(byte[] data, int pOffset, EscherRecordFactory recordFactory)

Implements abstract org.apache.poi.ddf.EscherRecord.fillFields.

Doc from org.apache.poi.ddf.EscherRecord.fillFields.

The contract of this method is to deserialize an escher record including its children.

Parameters
data:byte[]

The byte array containing the serialized escher records.

pOffset:int

The offset into the byte array.

recordFactory:EscherRecordFactory

A factory for creating new escher records.

Returns:int

The number of bytes written.

Annotations
@Override
fillFieldsback to summary
pack-priv int fillFields(byte[] data, int pOffset, EscherRecordFactory recordFactory, int nesting)
getChildback to summary
public EscherRecord getChild(int index)

Overrides org.apache.poi.ddf.EscherRecord.getChild.

Doc from org.apache.poi.ddf.EscherRecord.getChild.

Returns the indexed child record.

Parameters
index:int

the index of the child within the child records

Returns:EscherRecord

the indexed child record

Annotations
@Override
getChildByIdback to summary
public <T extends EscherRecord> T getChildById(short recordId)
getChildContainersback to summary
public List<EscherContainerRecord> getChildContainers()

Returns all of our children which are also EscherContainers (may be 0, 1, or vary rarely 2 or 3)

Returns:List<EscherContainerRecord>

EscherContainer children

getChildCountback to summary
public int getChildCount()
getChildRecordsback to summary
public List<EscherRecord> getChildRecords()

Overrides org.apache.poi.ddf.EscherRecord.getChildRecords.

Returns:List<EscherRecord>

a copy of the list of all the child records of the container.

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

Overrides org.apache.poi.ddf.EscherRecord.getGenericProperties.

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

Annotations
@Override
getGenericRecordTypeback to summary
public Enum<E extends Enum<E>> getGenericRecordType()

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

Annotations
@Override
getRecordNameback to summary
public String getRecordName()

Implements abstract org.apache.poi.ddf.EscherRecord.getRecordName.

Doc from org.apache.poi.ddf.EscherRecord.getRecordName.

Subclasses should return the short name for this escher record.

Returns:String

the short name for this escher record

Annotations
@Override
getRecordsByIdback to summary
public void getRecordsById(short recordId, List<EscherRecord> out)

Recursively find records with the specified record ID

Parameters
recordId:short

the recordId to be searched for

out:List<EscherRecord>

- list to store found records

getRecordSizeback to summary
public int getRecordSize()

Implements abstract org.apache.poi.ddf.EscherRecord.getRecordSize.

Doc from org.apache.poi.ddf.EscherRecord.getRecordSize.

Subclasses should effeciently return the number of bytes required to serialize the record.

Returns:int

number of bytes

Annotations
@Override
hasChildOfTypeback to summary
public boolean hasChildOfType(short recordId)

Do any of our (top level) children have the given recordId?

Parameters
recordId:short

the recordId of the child

Returns:boolean

true, if any child has the given recordId

iteratorback to summary
public Iterator<EscherRecord> iterator()

Implements java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Returns:Iterator<EscherRecord>

an iterator over the child records

Annotations
@Override
removeChildRecordback to summary
public boolean removeChildRecord(EscherRecord toBeRemoved)

Removes the given escher record from the child list

Parameters
toBeRemoved:EscherRecord

the escher record to be removed

Returns:boolean

true, if the record was found and removed

serializeback to summary
public int serialize(int offset, byte[] data, EscherSerializationListener listener)

Implements abstract org.apache.poi.ddf.EscherRecord.serialize.

Doc from org.apache.poi.ddf.EscherRecord.serialize.

Serializes the record to an existing byte array.

Parameters
offset:int

the offset within the byte array

data:byte[]

the data array to serialize to

listener:EscherSerializationListener

a listener for begin and end serialization events. This is useful because the serialization is hierarchical/recursive and sometimes you need to be able break into that.

Returns:int

the number of bytes written.

Annotations
@Override
setChildRecordsback to summary
public void setChildRecords(List<EscherRecord> childRecords)

Overrides org.apache.poi.ddf.EscherRecord.setChildRecords.

replaces the internal child list with the contents of the supplied childRecords

Parameters
childRecords:List<EscherRecord>

Doc from org.apache.poi.ddf.EscherRecord.setChildRecords.

Not used in base implementation.

Annotations
@Override
spliteratorback to summary
public Spliterator<EscherRecord> spliterator()

Overrides default java.lang.Iterable.spliterator.

Doc from java.lang.Iterable.spliterator.

Creates a Spliterator over the elements described by this Iterable.

Returns:Spliterator<EscherRecord>

a spliterator over the child records

Annotations
@Override
Since
POI 5.2.0