| java.lang.Object org.apache.poi.ddf.EscherRecord
All known Subclasses: org.apache.poi.ddf.EscherBlipRecord, org.apache.poi.ddf.EscherTextboxRecord, org.apache.poi.ddf.EscherSpRecord, org.apache.poi.ddf.EscherDggRecord, org.apache.poi.ddf.EscherClientDataRecord, org.apache.poi.ddf.EscherContainerRecord, org.apache.poi.ddf.EscherSplitMenuColorsRecord, org.apache.poi.ddf.EscherBSERecord, org.apache.poi.ddf.EscherClientAnchorRecord, org.apache.poi.ddf.EscherSpgrRecord, org.apache.poi.ddf.EscherOptRecord, org.apache.poi.ddf.EscherDgRecord, org.apache.poi.ddf.UnknownEscherRecord, org.apache.poi.ddf.EscherChildAnchorRecord,
EscherRecord | abstract public class EscherRecord (Code) | | The base abstract record from which all escher records are defined. Subclasses will need
to define methods for serialization/deserialization and for determining the record size.
author: Glen Stampoultzis |
Inner Class :static class EscherRecordHeader | |
Method Summary | |
public Object | clone() Escher records may need to be clonable in the future. | public void | display(PrintWriter w, int indent) The display methods allows escher variables to print the record names
according to their hierarchy. | protected int | fillFields(byte[] data, EscherRecordFactory f) | abstract public int | fillFields(byte[] data, int offset, EscherRecordFactory recordFactory) The contract of this method is to deserialize an escher record including
it's children.
Parameters: data - The byte array containing the serialized escherrecords. Parameters: offset - The offset into the byte array. Parameters: recordFactory - A factory for creating new escher records. | public EscherRecord | getChild(int index) Returns the indexed child record. | public List | getChildRecords() Returns the children of this record. | public short | getInstance() Returns the instance part of the option record. | public short | getOptions() The options field for this record. | public short | getRecordId() Return the current record id. | abstract public String | getRecordName() Subclasses should return the short name for this escher record. | abstract public int | getRecordSize() Subclasses should effeciently return the number of bytes required to
serialize the record. | public boolean | isContainerRecord() Determine whether this is a container record by inspecting the option
field. | protected int | readHeader(byte[] data, int offset) Reads the 8 byte header information and populates the options
and recordId records.
Parameters: data - the byte array to read from Parameters: offset - the offset to start reading from the number of bytes remaining in this record. | public byte[] | serialize() Serializes to a new byte array. | public int | serialize(int offset, byte[] data) Serializes to an existing byte array without serialization listener.
This is done by delegating to serialize(int, byte[], EscherSerializationListener).
Parameters: offset - the offset within the data byte array. Parameters: data - the data array to serialize to. | abstract public int | serialize(int offset, byte[] data, EscherSerializationListener listener) Serializes the record to an existing byte array.
Parameters: offset - the offset within the byte array Parameters: data - the data array to serialize to Parameters: listener - a listener for begin and end serialization events. | public void | setChildRecords(List childRecords) Sets the child records for this record. | public void | setOptions(short options) Set the options this this record. | public void | setRecordId(short recordId) Sets the record id for this record. |
EscherRecord | public EscherRecord()(Code) | | Create a new instance
|
clone | public Object clone()(Code) | | Escher records may need to be clonable in the future.
|
display | public void display(PrintWriter w, int indent)(Code) | | The display methods allows escher variables to print the record names
according to their hierarchy.
Parameters: w - The print writer to output to. Parameters: indent - The current indent level. |
fillFields | abstract public int fillFields(byte[] data, int offset, EscherRecordFactory recordFactory)(Code) | | The contract of this method is to deserialize an escher record including
it's children.
Parameters: data - The byte array containing the serialized escherrecords. Parameters: offset - The offset into the byte array. Parameters: recordFactory - A factory for creating new escher records. The number of bytes written. |
getChildRecords | public List getChildRecords()(Code) | | Returns the children of this record. By default this willbe an empty list. EscherCotainerRecord is the only recordthat may contain children. See Also: EscherContainerRecord |
getInstance | public short getInstance()(Code) | | Returns the instance part of the option record.
The instance part of the record |
getOptions | public short getOptions()(Code) | | The options field for this record. All records have one. |
getRecordId | public short getRecordId()(Code) | | Return the current record id.
The 16 bit record id. |
getRecordName | abstract public String getRecordName()(Code) | | Subclasses should return the short name for this escher record.
|
getRecordSize | abstract public int getRecordSize()(Code) | | Subclasses should effeciently return the number of bytes required to
serialize the record.
number of bytes |
isContainerRecord | public boolean isContainerRecord()(Code) | | Determine whether this is a container record by inspecting the option
field.
true is this is a container field. |
readHeader | protected int readHeader(byte[] data, int offset)(Code) | | Reads the 8 byte header information and populates the options
and recordId records.
Parameters: data - the byte array to read from Parameters: offset - the offset to start reading from the number of bytes remaining in this record. Thismay include the children if this is a container. |
serialize | public int serialize(int offset, byte[] data)(Code) | | Serializes to an existing byte array without serialization listener.
This is done by delegating to serialize(int, byte[], EscherSerializationListener).
Parameters: offset - the offset within the data byte array. Parameters: data - the data array to serialize to. The number of bytes written. See Also: EscherRecord.serialize(int,byte[],org.apache.poi.ddf.EscherSerializationListener) |
serialize | abstract public int serialize(int offset, byte[] data, EscherSerializationListener listener)(Code) | | Serializes the record to an existing byte array.
Parameters: offset - the offset within the byte array Parameters: data - the data array to serialize to Parameters: listener - a listener for begin and end serialization events. Thisis useful because the serialization ishierarchical/recursive and sometimes you need to be ablebreak into that. the number of bytes written. |
setChildRecords | public void setChildRecords(List childRecords)(Code) | | Sets the child records for this record. By default this will throw
an exception as only EscherContainerRecords may have children.
Parameters: childRecords - Not used in base implementation. |
setOptions | public void setOptions(short options)(Code) | | Set the options this this record. Container records should have the
last nibble set to 0xF.
|
setRecordId | public void setRecordId(short recordId)(Code) | | Sets the record id for this record.
|
|
|