public abstract class EscherRecord extends java.lang.Object implements Duplicatable, GenericRecord
Modifier | Constructor and Description |
---|---|
|
EscherRecord()
Create a new instance
(创建一个新实例)
|
protected |
EscherRecord(EscherRecord other) |
Modifier and Type | Method and Description |
---|---|
abstract EscherRecord |
copy() |
void |
display(java.io.PrintWriter w, int indent)
The display methods allows escher variables to print the record names according to their hierarchy.
(显示方法允许 escher 变量根据其层次结构打印记录名称。)
|
protected int |
fillFields(byte[] data, EscherRecordFactory f)
Delegates to fillFields(byte[], int, EscherRecordFactory)
(代表 fillFields(byte[], int, EscherRecordFactory))
|
abstract int |
fillFields(byte[] data, int offset, EscherRecordFactory recordFactory)
The contract of this method is to deserialize an escher record including it's children.
(此方法的约定是反序列化包括其子项的 escher 记录。)
|
EscherRecord |
getChild(int index)
Returns the indexed child record.
(返回索引的子记录。)
|
java.util.List<EscherRecord> |
getChildRecords() |
java.util.List<? extends GenericRecord> |
getGenericChildren() |
java.util.Map<java.lang.String,java.util.function.Supplier<?>> |
getGenericProperties() |
short |
getInstance()
Returns the instance part of the option record.
(返回选项记录的实例部分。)
|
short |
getOptions()
Note that
options is an internal field.
(请注意,options 是一个内部字段。)
|
short |
getRecordId()
Return the current record id.
(返回当前记录 id。)
|
abstract java.lang.String |
getRecordName()
Subclasses should return the short name for this escher record.
(子类应返回此 escher 记录的短名称。)
|
abstract int |
getRecordSize()
Subclasses should effeciently return the number of bytes required to serialize the record.
(子类应该有效地返回序列化记录所需的字节数。)
|
short |
getVersion()
Returns the version part of the option record.
(返回选项记录的版本部分。)
|
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.
(读取 8 字节的标头信息并填充 options 和 recordId 记录。)
|
protected static short |
readInstance(byte[] data, int offset)
Read the options field from header and return instance part of it.
(从标头中读取选项字段并返回其中的实例部分。)
|
byte[] |
serialize()
Serializes to a new byte array.
(序列化为一个新的字节数组。)
|
int |
serialize(int offset, byte[] data)
Serializes to an existing byte array without serialization listener.
(在没有序列化侦听器的情况下序列化到现有字节数组。)
|
abstract int |
serialize(int offset, byte[] data, EscherSerializationListener listener)
Serializes the record to an existing byte array.
(将记录序列化为现有字节数组。)
|
void |
setChildRecords(java.util.List<EscherRecord> childRecords)
Sets the child records for this record.
(设置此记录的子记录。)
|
void |
setInstance(short value)
Sets the instance part of record
(设置记录的实例部分)
|
void |
setOptions(short options)
Set the options this this record.
(设置此记录的选项。)
|
void |
setRecordId(short recordId)
Sets the record id for this record.
(设置此记录的记录 ID。)
|
void |
setVersion(short value)
Sets the version part of record
(设置记录的版本部分)
|
java.lang.String |
toString() |
java.lang.String |
toXml() |
java.lang.String |
toXml(java.lang.String tab) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getGenericRecordType
public EscherRecord()
protected EscherRecord(EscherRecord other)
protected int fillFields(byte[] data, EscherRecordFactory f)
data
- they bytes to serialize from
(数据 - 它们要序列化的字节)
f
- the escher record factory
(f - 埃舍尔唱片厂)
fillFields(byte[], int, org.apache.poi.ddf.EscherRecordFactory)
public abstract int fillFields(byte[] data, int offset, EscherRecordFactory recordFactory)
data
- The byte array containing the serialized escher records.
(data - 包含序列化 escher 记录的字节数组。)
offset
- The offset into the byte array.
(offset - 字节数组的偏移量。)
recordFactory
- A factory for creating new escher records.
(recordFactory - 用于创建新 escher 记录的工厂。)
protected int readHeader(byte[] data, int offset)
options
and
recordId
records.
(读取 8 字节的标头信息并填充 options 和 recordId 记录。)
data
- the byte array to read from
(data - 要读取的字节数组)
offset
- the offset to start reading from
(offset - 开始读取的偏移量)
protected static short readInstance(byte[] data, int offset)
data
- the byte array to read from
(data - 要读取的字节数组)
offset
- the offset to start reading from
(offset - 开始读取的偏移量)
public boolean isContainerRecord()
@Internal public short getOptions()
options
is an internal field. Use
setInstance(short)
()} and
setVersion(short)
()} to set the actual fields.
(请注意,options 是一个内部字段。使用 setInstance(short) ()} 和 setVersion(short) ()} 设置实际字段。)
@Internal public void setOptions(short options)
Note that options
is an internal field. Use getInstance()
and getVersion()
to access actual fields.
options
- the record options
(options - 记录选项)
public byte[] serialize()
serialize(int, byte[])
public int serialize(int offset, byte[] data)
offset
- the offset within the data byte array.
(offset - 数据字节数组中的偏移量。)
data
- the data array to serialize to.
(data - 要序列化到的数据数组。)
serialize(int, byte[], org.apache.poi.ddf.EscherSerializationListener)
public abstract int serialize(int offset, byte[] data, EscherSerializationListener listener)
offset
- the offset within the byte array
(offset - 字节数组中的偏移量)
data
- the data array to serialize to
(data - 要序列化到的数据数组)
listener
- 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 - 开始和结束序列化事件的侦听器。这很有用,因为序列化是分层/递归的,有时您需要能够打破它。)
public abstract int getRecordSize()
public short getRecordId()
public void setRecordId(short recordId)
recordId
- the record id
(recordId - 记录 ID)
public java.util.List<EscherRecord> getChildRecords()
EscherContainerRecord
public void setChildRecords(java.util.List<EscherRecord> childRecords)
childRecords
- Not used in base implementation.
(childRecords - 不在基本实现中使用。)
public EscherRecord getChild(int index)
index
- the index of the child within the child records
(index - 子记录中的子索引)
public void display(java.io.PrintWriter w, int indent)
w
- The print writer to output to.
(w - 要输出到的打印编写器。)
indent
- The current indent level.
(indent - 当前缩进级别。)
public abstract java.lang.String getRecordName()
public short getInstance()
public void setInstance(short value)
value
- instance part value
(value - 实例部分值)
public short getVersion()
public void setVersion(short value)
value
- version part value
(value - 版本部分值)
public java.lang.String toXml()
public final java.lang.String toXml(java.lang.String tab)
tab
- - each children must be indented right relative to its parent
(tab - - 每个子级必须相对于其父级缩进)
public final java.lang.String toString()
toString
in class
java.lang.Object
public java.util.List<? extends GenericRecord> getGenericChildren()
getGenericChildren
in interface
GenericRecord
(接口 GenericRecord 中的 getGenericChildren)
public java.util.Map<java.lang.String,java.util.function.Supplier<?>> getGenericProperties()
getGenericProperties
in interface
GenericRecord
(接口 GenericRecord 中的 getGenericProperties)
public abstract EscherRecord copy()
copy
in interface
Duplicatable
(复制到界面 Duplicatable)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.