Search in sources :

Example 1 with DefaultMarshaller

use of org.apache.poi.openxml4j.opc.internal.marshallers.DefaultMarshaller in project poi by apache.

the class OPCPackage method init.

/**
	 * Initialize the package instance.
	 */
private void init() {
    this.partMarshallers = new HashMap<ContentType, PartMarshaller>(5);
    this.partUnmarshallers = new HashMap<ContentType, PartUnmarshaller>(2);
    try {
        // Add 'default' unmarshaller
        this.partUnmarshallers.put(new ContentType(ContentTypes.CORE_PROPERTIES_PART), new PackagePropertiesUnmarshaller());
        // Add default marshaller
        this.defaultPartMarshaller = new DefaultMarshaller();
        // TODO Delocalize specialized marshallers
        this.partMarshallers.put(new ContentType(ContentTypes.CORE_PROPERTIES_PART), new ZipPackagePropertiesMarshaller());
    } catch (InvalidFormatException e) {
        // Should never happen
        throw new OpenXML4JRuntimeException("Package.init() : this exception should never happen, " + "if you read this message please send a mail to the developers team. : " + e.getMessage(), e);
    }
}
Also used : DefaultMarshaller(org.apache.poi.openxml4j.opc.internal.marshallers.DefaultMarshaller) ContentType(org.apache.poi.openxml4j.opc.internal.ContentType) PartMarshaller(org.apache.poi.openxml4j.opc.internal.PartMarshaller) PartUnmarshaller(org.apache.poi.openxml4j.opc.internal.PartUnmarshaller) PackagePropertiesUnmarshaller(org.apache.poi.openxml4j.opc.internal.unmarshallers.PackagePropertiesUnmarshaller) ZipPackagePropertiesMarshaller(org.apache.poi.openxml4j.opc.internal.marshallers.ZipPackagePropertiesMarshaller) InvalidFormatException(org.apache.poi.openxml4j.exceptions.InvalidFormatException) OpenXML4JRuntimeException(org.apache.poi.openxml4j.exceptions.OpenXML4JRuntimeException)

Aggregations

InvalidFormatException (org.apache.poi.openxml4j.exceptions.InvalidFormatException)1 OpenXML4JRuntimeException (org.apache.poi.openxml4j.exceptions.OpenXML4JRuntimeException)1 ContentType (org.apache.poi.openxml4j.opc.internal.ContentType)1 PartMarshaller (org.apache.poi.openxml4j.opc.internal.PartMarshaller)1 PartUnmarshaller (org.apache.poi.openxml4j.opc.internal.PartUnmarshaller)1 DefaultMarshaller (org.apache.poi.openxml4j.opc.internal.marshallers.DefaultMarshaller)1 ZipPackagePropertiesMarshaller (org.apache.poi.openxml4j.opc.internal.marshallers.ZipPackagePropertiesMarshaller)1 PackagePropertiesUnmarshaller (org.apache.poi.openxml4j.opc.internal.unmarshallers.PackagePropertiesUnmarshaller)1