Class XSSFObjectData

All Implemented Interfaces:
Iterable<XSSFTextParagraph>, ObjectData, Shape, SimpleShape, TextContainer

public class XSSFObjectData extends XSSFSimpleShape implements ObjectData
Represents binary object (i.e. OLE) data stored in the file. Eg. A GIF, JPEG etc...
  • Constructor Details

    • XSSFObjectData

      protected XSSFObjectData(XSSFDrawing drawing, org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShape ctShape)
  • Method Details

    • prototype

      protected static org.openxmlformats.schemas.drawingml.x2006.spreadsheetDrawing.CTShape prototype()
      Prototype with the default structure of a new auto-shape.
    • getOLE2ClassName

      public String getOLE2ClassName()
      Specified by:
      getOLE2ClassName in interface ObjectData
      Returns:
      the OLE2 Class Name of the object
    • getOleObject

      public org.openxmlformats.schemas.spreadsheetml.x2006.main.CTOleObject getOleObject()
      Returns:
      the CTOleObject associated with the shape
    • getObjectData

      public byte[] getObjectData() throws IOException
      Specified by:
      getObjectData in interface ObjectData
      Returns:
      the data portion, for an ObjectData that doesn't have an associated POIFS Directory Entry
      Throws:
      IOException
    • getObjectPart

      public PackagePart getObjectPart()
      Returns:
      the package part of the object data
    • hasDirectoryEntry

      public boolean hasDirectoryEntry()
      Specified by:
      hasDirectoryEntry in interface ObjectData
      Returns:
      does this ObjectData have an associated POIFS Directory Entry? (Not all do, those that don't have a data portion)
    • getDirectory

      public DirectoryEntry getDirectory() throws IOException
      Description copied from interface: ObjectData
      Gets the object data. Only call for ones that have data though. See ObjectData.hasDirectoryEntry(). The caller has to close the corresponding POIFSFileSystem
      Specified by:
      getDirectory in interface ObjectData
      Returns:
      the object data as an OLE2 directory.
      Throws:
      IOException - if there was an error reading the data.
    • getFileName

      public String getFileName()
      The filename of the embedded image
      Specified by:
      getFileName in interface ObjectData
      Returns:
      a filename suggestion - inspecting/interpreting the Directory object probably gives a better result
    • getSheet

      protected XSSFSheet getSheet()
    • getPictureData

      public XSSFPictureData getPictureData()
      Specified by:
      getPictureData in interface ObjectData
      Returns:
      the preview picture
    • getContentType

      public String getContentType()
      Specified by:
      getContentType in interface ObjectData