Package org.apache.poi.ddf
Class DefaultEscherRecordFactory
- java.lang.Object
-
- org.apache.poi.ddf.DefaultEscherRecordFactory
-
- All Implemented Interfaces:
EscherRecordFactory
- Direct Known Subclasses:
HSLFEscherRecordFactory
public class DefaultEscherRecordFactory extends java.lang.Object implements EscherRecordFactory
Generates escher records when provided the byte array containing those records.- See Also:
EscherRecordFactory
-
-
Constructor Summary
Constructors Constructor Description DefaultEscherRecordFactory()
Creates an instance of the escher record factory
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description EscherRecord
createRecord(byte[] data, int offset)
Generates an escher record including any children contained under that record.static boolean
isContainer(short options, short recordId)
protected static java.util.Map<java.lang.Short,java.lang.reflect.Constructor<? extends EscherRecord>>
recordsToMap(java.lang.Class<?>[] recClasses)
Converts from a list of classes into a map that contains the record id as the key and the Constructor in the value part of the map.
-
-
-
Method Detail
-
createRecord
public EscherRecord createRecord(byte[] data, int offset)
Description copied from interface:EscherRecordFactory
Generates an escher record including any children contained under that record. An exception is thrown if the record could not be generated.- Specified by:
createRecord
in interfaceEscherRecordFactory
- Parameters:
data
- The byte array containing the recordsoffset
- The starting offset into the byte array- Returns:
- The generated escher record
-
recordsToMap
protected static java.util.Map<java.lang.Short,java.lang.reflect.Constructor<? extends EscherRecord>> recordsToMap(java.lang.Class<?>[] recClasses)
Converts from a list of classes into a map that contains the record id as the key and the Constructor in the value part of the map. It does this by using reflection to look up the RECORD_ID field then using reflection again to find a reference to the constructor.- Parameters:
recClasses
- The records to convert- Returns:
- The map containing the id/constructor pairs.
-
isContainer
public static boolean isContainer(short options, short recordId)
-
-