Package org.apache.poi.xssf.usermodel
Class XSSFObjectData
- java.lang.Object
-
- org.apache.poi.xssf.usermodel.XSSFShape
-
- org.apache.poi.xssf.usermodel.XSSFSimpleShape
-
- org.apache.poi.xssf.usermodel.XSSFObjectData
-
- All Implemented Interfaces:
java.lang.Iterable<XSSFTextParagraph>,ObjectData,Shape,SimpleShape,org.apache.poi.xddf.usermodel.text.TextContainer
public class XSSFObjectData extends XSSFSimpleShape implements ObjectData
Represents binary object (i.e. OLE) data stored in the file. Eg. A GIF, JPEG etc...
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetContentType()DirectoryEntrygetDirectory()Gets the object data.java.lang.StringgetFileName()The filename of the embedded imagebyte[]getObjectData()PackagePartgetObjectPart()java.lang.StringgetOLE2ClassName()CTOleObjectgetOleObject()XSSFPictureDatagetPictureData()booleanhasDirectoryEntry()-
Methods inherited from class org.apache.poi.xssf.usermodel.XSSFSimpleShape
addNewTextParagraph, addNewTextParagraph, addNewTextParagraph, clearText, findDefinedParagraphProperty, findDefinedRunProperty, getBottomInset, getCTShape, getLeftInset, getRightInset, getShapeId, getShapeName, getShapeType, getText, getTextAutofit, getTextBody, getTextDirection, getTextHorizontalOverflow, getTextParagraphs, getTextVerticalOverflow, getTopInset, getVerticalAlignment, getWordWrap, iterator, setBottomInset, setLeftInset, setRightInset, setShapeType, setText, setText, setTextAutofit, setTextDirection, setTextHorizontalOverflow, setTextVerticalOverflow, setTopInset, setVerticalAlignment, setWordWrap
-
Methods inherited from class org.apache.poi.xssf.usermodel.XSSFShape
getAnchor, getDrawing, getParent, isNoFill, setFillColor, setLineStyle, setLineStyleColor, setLineWidth, setNoFill
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.poi.ss.usermodel.Shape
getAnchor, getParent, getShapeName, isNoFill, setFillColor, setLineStyleColor, setNoFill
-
Methods inherited from interface org.apache.poi.ss.usermodel.SimpleShape
getShapeId
-
-
-
-
Method Detail
-
getOLE2ClassName
public java.lang.String getOLE2ClassName()
- Specified by:
getOLE2ClassNamein interfaceObjectData- Returns:
- the OLE2 Class Name of the object
-
getOleObject
public CTOleObject getOleObject()
- Returns:
- the CTOleObject associated with the shape
-
getObjectData
public byte[] getObjectData() throws java.io.IOException- Specified by:
getObjectDatain interfaceObjectData- Returns:
- the data portion, for an ObjectData that doesn't have an associated POIFS Directory Entry
- Throws:
java.io.IOException
-
getObjectPart
public PackagePart getObjectPart()
- Returns:
- the package part of the object data
-
hasDirectoryEntry
public boolean hasDirectoryEntry()
- Specified by:
hasDirectoryEntryin interfaceObjectData- 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 java.io.IOException
Description copied from interface:ObjectDataGets the object data. Only call for ones that have data though. SeeObjectData.hasDirectoryEntry(). The caller has to close the corresponding POIFSFileSystem- Specified by:
getDirectoryin interfaceObjectData- Returns:
- the object data as an OLE2 directory.
- Throws:
java.io.IOException- if there was an error reading the data.
-
getFileName
public java.lang.String getFileName()
The filename of the embedded image- Specified by:
getFileNamein interfaceObjectData- Returns:
- a filename suggestion - inspecting/interpreting the Directory object probably gives a better result
-
getPictureData
public XSSFPictureData getPictureData()
- Specified by:
getPictureDatain interfaceObjectData- Returns:
- the preview picture
-
getContentType
public java.lang.String getContentType()
- Specified by:
getContentTypein interfaceObjectData
-
-