Class Part

java.lang.Object
org.docx4j.xmlPackage.Part

public class Part
extends java.lang.Object
Defines a part of a package using open package conventions. A part with contentType containing xml requires xmlData. All other contentType values use binaryData.

Java class for CT_Part complex type.

The following schema fragment specifies the expected content contained within this class.

 <complexType name="CT_Part">
   <complexContent>
     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       <choice>
         <element name="xmlData" type="{http://schemas.microsoft.com/office/2006/xmlPackage}CT_XmlData"/>
         <element name="binaryData" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
       </choice>
       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       <attribute name="contentType">
         <simpleType>
           <restriction base="{http://www.w3.org/2001/XMLSchema}string">
             <pattern value="text/xml"/>
             <pattern value="application/xml"/>
             <pattern value="application/.+\+xml"/>
             <pattern value=".+"/>
           </restriction>
         </simpleType>
       </attribute>
       <attribute name="compression" default="deflateSuperFast">
         <simpleType>
           <restriction base="{http://www.w3.org/2001/XMLSchema}string">
             <enumeration value="store"/>
             <enumeration value="deflateSuperFast"/>
             <enumeration value="deflateFast"/>
             <enumeration value="deflateNormal"/>
             <enumeration value="deflateMaximum"/>
           </restriction>
         </simpleType>
       </attribute>
       <attribute name="padding" type="{http://www.w3.org/2001/XMLSchema}unsignedInt" default="0" />
     </restriction>
   </complexContent>
 </complexType>
 
  • Field Summary

    Fields
    Modifier and Type Field Description
    protected byte[] binaryData  
    protected java.lang.String compression  
    protected java.lang.String contentType  
    protected java.lang.String name  
    protected java.lang.Long padding  
    protected XmlData xmlData  
  • Constructor Summary

    Constructors
    Constructor Description
    Part()  
  • Method Summary

    Modifier and Type Method Description
    byte[] getBinaryData()
    Gets the value of the binaryData property.
    java.lang.String getCompression()
    Gets the value of the compression property.
    java.lang.String getContentType()
    Gets the value of the contentType property.
    java.lang.String getName()
    Gets the value of the name property.
    long getPadding()
    Gets the value of the padding property.
    XmlData getXmlData()
    Gets the value of the xmlData property.
    void setBinaryData​(byte[] value)
    Sets the value of the binaryData property.
    void setCompression​(java.lang.String value)
    Sets the value of the compression property.
    void setContentType​(java.lang.String value)
    Sets the value of the contentType property.
    void setName​(java.lang.String value)
    Sets the value of the name property.
    void setPadding​(java.lang.Long value)
    Sets the value of the padding property.
    void setXmlData​(XmlData value)
    Sets the value of the xmlData property.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • xmlData

      protected XmlData xmlData
    • binaryData

      protected byte[] binaryData
    • name

      protected java.lang.String name
    • contentType

      protected java.lang.String contentType
    • compression

      protected java.lang.String compression
    • padding

      protected java.lang.Long padding
  • Constructor Details

    • Part

      public Part()
  • Method Details

    • getXmlData

      public XmlData getXmlData()
      Gets the value of the xmlData property.
      Returns:
      possible object is XmlData
    • setXmlData

      public void setXmlData​(XmlData value)
      Sets the value of the xmlData property.
      Parameters:
      value - allowed object is XmlData
    • getBinaryData

      public byte[] getBinaryData()
      Gets the value of the binaryData property.
      Returns:
      possible object is byte[]
    • setBinaryData

      public void setBinaryData​(byte[] value)
      Sets the value of the binaryData property.
      Parameters:
      value - allowed object is byte[]
    • getName

      public java.lang.String getName()
      Gets the value of the name property.
      Returns:
      possible object is String
    • setName

      public void setName​(java.lang.String value)
      Sets the value of the name property.
      Parameters:
      value - allowed object is String
    • getContentType

      public java.lang.String getContentType()
      Gets the value of the contentType property.
      Returns:
      possible object is String
    • setContentType

      public void setContentType​(java.lang.String value)
      Sets the value of the contentType property.
      Parameters:
      value - allowed object is String
    • getCompression

      public java.lang.String getCompression()
      Gets the value of the compression property.
      Returns:
      possible object is String
    • setCompression

      public void setCompression​(java.lang.String value)
      Sets the value of the compression property.
      Parameters:
      value - allowed object is String
    • getPadding

      public long getPadding()
      Gets the value of the padding property.
      Returns:
      possible object is Long
    • setPadding

      public void setPadding​(java.lang.Long value)
      Sets the value of the padding property.
      Parameters:
      value - allowed object is Long