Package org.apache.poi.ddf
Class DefaultEscherRecordFactory
java.lang.Object
org.apache.poi.ddf.DefaultEscherRecordFactory
- All Implemented Interfaces:
EscherRecordFactory
- Direct Known Subclasses:
HSLFEscherRecordFactory
Generates escher records when provided the byte array containing those records.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of the escher record factory -
Method Summary
Modifier and TypeMethodDescriptioncreateRecord
(byte[] data, int offset) Generates an escher record including any children contained under that record.static boolean
isContainer
(short options, short recordId) protected static Map<Short,
Constructor<? extends EscherRecord>> recordsToMap
(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.
-
Constructor Details
-
DefaultEscherRecordFactory
public DefaultEscherRecordFactory()Creates an instance of the escher record factory
-
-
Method Details
-
createRecord
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
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)
-