Package org.apache.poi.ddf
Class EscherComplexProperty
- java.lang.Object
-
- org.apache.poi.ddf.EscherProperty
-
- org.apache.poi.ddf.EscherComplexProperty
-
- All Implemented Interfaces:
GenericRecord
- Direct Known Subclasses:
EscherArrayProperty
public class EscherComplexProperty extends EscherProperty
A complex property differs from a simple property in that the data can not fit inside a 32 bit integer. See the specification for more detailed information regarding exactly what is stored here.
-
-
Constructor Summary
Constructors Constructor Description EscherComplexProperty(short propertyNumber, boolean isBlipId, int complexSize)
Create a complex property using the property number, a flag to indicate whether this is a blip reference and the complex property data size.EscherComplexProperty(short id, int complexSize)
Create a complex property using the property id and a byte array containing the complex data value size.EscherComplexProperty(EscherPropertyTypes type, boolean isBlipId, int complexSize)
Create a complex property using the property type, a flag to indicate whether this is a blip reference and the complex property data size.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
Determine whether this property is equal to another property.byte[]
getComplexData()
Get the complex data value.Map<String,Supplier<?>>
getGenericProperties()
static int
getMaxRecordLength()
int
getPropertySize()
Calculates the number of bytes required to serialize this property.int
hashCode()
protected void
resizeComplexData(int newSize)
protected void
resizeComplexData(int newSize, int copyLen)
int
serializeComplexPart(byte[] data, int pos)
Serializes the complex part of this propertyint
serializeSimplePart(byte[] data, int pos)
Serializes the simple part of this property.int
setComplexData(byte[] complexData)
int
setComplexData(byte[] complexData, int offset)
static void
setMaxRecordLength(int length)
-
Methods inherited from class org.apache.poi.ddf.EscherProperty
getGenericChildren, getGenericRecordType, getId, getName, getPropertyNumber, isBlipId, isComplex, toString, toXml
-
-
-
-
Constructor Detail
-
EscherComplexProperty
public EscherComplexProperty(short id, int complexSize)
Create a complex property using the property id and a byte array containing the complex data value size.- Parameters:
id
- The id consists of the property number, a flag indicating whether this is a blip id and a flag indicating that this is a complex property.complexSize
- The byte size of this property.
-
EscherComplexProperty
public EscherComplexProperty(short propertyNumber, boolean isBlipId, int complexSize)
Create a complex property using the property number, a flag to indicate whether this is a blip reference and the complex property data size.- Parameters:
propertyNumber
- The property numberisBlipId
- Whether this is a blip id. Should be false.complexSize
- The byte size of this property.
-
EscherComplexProperty
public EscherComplexProperty(EscherPropertyTypes type, boolean isBlipId, int complexSize)
Create a complex property using the property type, a flag to indicate whether this is a blip reference and the complex property data size.- Parameters:
type
- The property typeisBlipId
- Whether this is a blip id. Should be false.complexSize
- The byte size of this property.
-
-
Method Detail
-
setMaxRecordLength
public static void setMaxRecordLength(int length)
- Parameters:
length
- the max record length allowed for EscherComplexProperty
-
getMaxRecordLength
public static int getMaxRecordLength()
- Returns:
- the max record length allowed for EscherComplexProperty
-
serializeSimplePart
public int serializeSimplePart(byte[] data, int pos)
Serializes the simple part of this property. i.e. the first 6 bytes.- Specified by:
serializeSimplePart
in classEscherProperty
- Parameters:
data
- the buffer to write topos
- the starting position- Returns:
- the length of the part
-
serializeComplexPart
public int serializeComplexPart(byte[] data, int pos)
Serializes the complex part of this property- Specified by:
serializeComplexPart
in classEscherProperty
- Parameters:
data
- The data array to serialize topos
- The offset within data to start serializing to.- Returns:
- The number of bytes serialized.
-
getComplexData
public byte[] getComplexData()
Get the complex data value.- Returns:
- the complex bytes
-
setComplexData
public int setComplexData(byte[] complexData)
-
setComplexData
public int setComplexData(byte[] complexData, int offset)
-
resizeComplexData
protected void resizeComplexData(int newSize)
-
resizeComplexData
protected void resizeComplexData(int newSize, int copyLen)
-
equals
public boolean equals(Object o)
Determine whether this property is equal to another property.
-
getPropertySize
public int getPropertySize()
Calculates the number of bytes required to serialize this property.- Overrides:
getPropertySize
in classEscherProperty
- Returns:
- Number of bytes
-
getGenericProperties
public Map<String,Supplier<?>> getGenericProperties()
- Specified by:
getGenericProperties
in interfaceGenericRecord
- Overrides:
getGenericProperties
in classEscherProperty
-
-