Package org.apache.poi.openxml4j.opc.internal

Examples of org.apache.poi.openxml4j.opc.internal.ContentType


    this.partMarshallers = new Hashtable<ContentType, PartMarshaller>(5);
    this.partUnmarshallers = new Hashtable<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(
View Full Code Here


   * @param marshaller
   *            The marshaller to register with the specified content type.
   */
  public void addMarshaller(String contentType, PartMarshaller marshaller) {
    try {
      partMarshallers.put(new ContentType(contentType), marshaller);
    } catch (InvalidFormatException e) {
      logger.log(POILogger.WARN, "The specified content type is not valid: '"
          + e.getMessage() + "'. The marshaller will not be added !");
    }
  }
View Full Code Here

   *            The unmarshaller to register with the specified content type.
   */
  public void addUnmarshaller(String contentType,
      PartUnmarshaller unmarshaller) {
    try {
      partUnmarshallers.put(new ContentType(contentType), unmarshaller);
    } catch (InvalidFormatException e) {
      logger.log(POILogger.WARN, "The specified content type is not valid: '"
          + e.getMessage()
          + "'. The unmarshaller will not be added !");
    }
View Full Code Here

    this.partMarshallers = new Hashtable<ContentType, PartMarshaller>(5);
    this.partUnmarshallers = new Hashtable<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(
View Full Code Here

   * @param marshaller
   *            The marshaller to register with the specified content type.
   */
  public void addMarshaller(String contentType, PartMarshaller marshaller) {
    try {
      partMarshallers.put(new ContentType(contentType), marshaller);
    } catch (InvalidFormatException e) {
      logger.log(POILogger.WARN, "The specified content type is not valid: '"
          + e.getMessage() + "'. The marshaller will not be added !");
    }
  }
View Full Code Here

   *            The unmarshaller to register with the specified content type.
   */
  public void addUnmarshaller(String contentType,
      PartUnmarshaller unmarshaller) {
    try {
      partUnmarshallers.put(new ContentType(contentType), unmarshaller);
    } catch (InvalidFormatException e) {
      logger.log(POILogger.WARN, "The specified content type is not valid: '"
          + e.getMessage()
          + "'. The unmarshaller will not be added !");
    }
View Full Code Here

   *            The Multipurpose Internet Mail Extensions (MIME) content type
   *            of the part's data stream.
   */
  public PackagePart(OPCPackage pack, PackagePartName partName,
      String contentType) throws InvalidFormatException {
    this(pack, partName, new ContentType(contentType));
  }
View Full Code Here

   *             part is already attached to a package.
   */
  public void setContentType(String contentType)
      throws InvalidFormatException {
    if (container == null)
      this.contentType = new ContentType(contentType);
    else
      throw new InvalidOperationException(
          "You can't change the content type of a part.");
  }
View Full Code Here

    this.partMarshallers = new Hashtable<ContentType, PartMarshaller>(5);
    this.partUnmarshallers = new Hashtable<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(
View Full Code Here

   * @param marshaller
   *            The marshaller to register with the specified content type.
   */
  public void addMarshaller(String contentType, PartMarshaller marshaller) {
    try {
      partMarshallers.put(new ContentType(contentType), marshaller);
    } catch (InvalidFormatException e) {
      logger.log(POILogger.WARN, "The specified content type is not valid: '"
          + e.getMessage() + "'. The marshaller will not be added !");
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.poi.openxml4j.opc.internal.ContentType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.