Top Description Fields Constructors Methods
org.apache.poi.sl.extractor

public Class SlideShowExtractor<S extends Shape<S, P>, P extends TextParagraph<S, P, ? extends TextRun>>

extends Object
implements POITextExtractor
Class Inheritance
All Implemented Interfaces
org.apache.poi.extractor.POITextExtractor, java.io.Closeable, java.lang.AutoCloseable
Imports
java.util.ArrayList, .BitSet, .LinkedList, .List, java.util.function.Consumer, .Function, .Predicate, com.zaxxer.sparsebits.SparseBitSet, org.apache.logging.log4j.LogManager, .Logger, org.apache.poi.extractor.POITextExtractor, org.apache.poi.sl.usermodel.MasterSheet, .Notes, .ObjectShape, .Placeholder, .PlaceholderDetails, .Shape, .ShapeContainer, .Sheet, .Slide, .SlideShow, .TableCell, .TableShape, .TextParagraph, .TextRun, .TextShape, org.apache.poi.util.Internal, .LocaleUtil, .Removal

Common SlideShow extractor
Since
POI 4.0.0

Field Summary

Modifier and TypeField and Description
private boolean
private boolean
private Predicate<Object>
private static final Logger
private boolean
private boolean
private static final String
private boolean
protected final SlideShow<S, P>

Constructor Summary

AccessConstructor and Description
public
SlideShowExtractor(final SlideShow<S, P> slideshow)

Method Summary

Modifier and TypeMethod and Description
private void
addOLEShapes(final List<ObjectShape<S, P>> oleShapes, ShapeContainer<S, P> container)

private void
addSheetPlaceholderDatails(final Sheet<S, P> sheet, final Placeholder placeholder, final Consumer<String> consumer)

private static boolean
filterFonts(Object o, String typeface, Boolean italic, Boolean bold)

public BitSet

Returns:

a bitset with the marked/used codepoints
getCodepoints
(String
the typeface/font family of the textruns to examine
typeface
,
Boolean
use true for italic TextRuns, false for non-italic ones and null if it doesn't matter
italic
,
Boolean
use true for bold TextRuns, false for non-bold ones and null if it doesn't matter
bold
)

Extract the used codepoints for font embedding / subsetting

public SparseBitSet

Returns:

a bitset with the marked/used codepoints
getCodepointsInSparseBitSet
(String
the typeface/font family of the textruns to examine
typeface
,
Boolean
use true for italic TextRuns, false for non-italic ones and null if it doesn't matter
italic
,
Boolean
use true for bold TextRuns, false for non-bold ones and null if it doesn't matter
bold
)

Extract the used codepoints for font embedding / subsetting.

public SlideShow<S, P>

Returns:

the opened document
getDocument
()

Implements org.apache.poi.extractor.POITextExtractor.getDocument.

Returns opened document

public SlideShow<S, P>
public POITextExtractor
getMetadataTextExtractor()

Implements org.apache.poi.extractor.POITextExtractor.getMetadataTextExtractor.

Returns another text extractor, which is able to output the textual content of the document metadata / properties, such as author and title.

public List<? extends ObjectShape<S, P>>
public String
getText()

Implements org.apache.poi.extractor.POITextExtractor.getText.

Fetches all the slide text from the slideshow, but not the notes, unless you've called setSlidesByDefault() and setNotesByDefault() to change this

public String
getText(final Slide<S, P> slide)

private void
getText(final Slide<S, P> slide, final Consumer<String> consumer)

public boolean
private void
printComments(final Slide<S, P> slide, final Consumer<String> consumer)

private void
printHeaderFooter(final Sheet<S, P> sheet, final Consumer<String> consumer, final Consumer<String> footerCon)

private void
printNotes(final Slide<S, P> slide, final Consumer<String> consumer)

private void
printShapeText(final Sheet<S, P> sheet, final Consumer<String> consumer)

private void
printShapeText(final ShapeContainer<S, P> container, final Consumer<String> consumer)

private void
printShapeText(final TableShape<S, P> shape, final Consumer<String> consumer)

private void
printSlideMaster(final MasterSheet<S, P> master, final Consumer<String> consumer)

private void
printTextParagraphs(final List<P> paras, final Consumer<String> consumer)

private void
printTextParagraphs(final List<P> paras, final Consumer<String> consumer, String trailer)

private void
printTextParagraphs(final List<P> paras, final Consumer<String> consumer, String trailer, final Function<TextRun, String> converter)

private static String
private static String
public void
setCloseFilesystem(boolean
true (default), if underlying resources/filesystem should be closed on close()
doCloseFilesystem
)

Implements org.apache.poi.extractor.POITextExtractor.setCloseFilesystem.

public void
setCommentsByDefault(final boolean commentsByDefault)

Should a call to getText() return comments text?

public void
setMasterByDefault(final boolean masterByDefault)

Should a call to getText() return text from master?

public void
setNotesByDefault(final boolean notesByDefault)

Should a call to getText() return notes text?

public void
setSlidesByDefault(final boolean slidesByDefault)

Should a call to getText() return slide text?

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

commentsByDefaultback to summary
private boolean commentsByDefault
doCloseFilesystemback to summary
private boolean doCloseFilesystem
filterback to summary
private Predicate<Object> filter
LOGback to summary
private static final Logger LOG
masterByDefaultback to summary
private boolean masterByDefault
notesByDefaultback to summary
private boolean notesByDefault
SLIDE_NUMBER_PHback to summary
private static final String SLIDE_NUMBER_PH
slidesByDefaultback to summary
private boolean slidesByDefault
slideshowback to summary
protected final SlideShow<S, P> slideshow

Constructor Detail

SlideShowExtractorback to summary
public SlideShowExtractor(final SlideShow<S, P> slideshow)

Method Detail

addOLEShapesback to summary
private void addOLEShapes(final List<ObjectShape<S, P>> oleShapes, ShapeContainer<S, P> container)
Annotations
@SuppressWarnings:unchecked
addSheetPlaceholderDatailsback to summary
private void addSheetPlaceholderDatails(final Sheet<S, P> sheet, final Placeholder placeholder, final Consumer<String> consumer)
filterFontsback to summary
private static boolean filterFonts(Object o, String typeface, Boolean italic, Boolean bold)
getCodepointsback to summary
public BitSet getCodepoints(String typeface, Boolean italic, Boolean bold)

Extract the used codepoints for font embedding / subsetting

Parameters
typeface:String

the typeface/font family of the textruns to examine

italic:Boolean

use true for italic TextRuns, false for non-italic ones and null if it doesn't matter

bold:Boolean

use true for bold TextRuns, false for non-bold ones and null if it doesn't matter

Returns:BitSet

a bitset with the marked/used codepoints

Annotations
@Deprecated
@Removal
version:6.0.0
getCodepointsInSparseBitSetback to summary
public SparseBitSet getCodepointsInSparseBitSet(String typeface, Boolean italic, Boolean bold)

Extract the used codepoints for font embedding / subsetting. This method is not intended for public use.

Parameters
typeface:String

the typeface/font family of the textruns to examine

italic:Boolean

use true for italic TextRuns, false for non-italic ones and null if it doesn't matter

bold:Boolean

use true for bold TextRuns, false for non-bold ones and null if it doesn't matter

Returns:SparseBitSet

a bitset with the marked/used codepoints

Annotations
@Internal
getDocumentback to summary
public SlideShow<S, P> getDocument()

Implements org.apache.poi.extractor.POITextExtractor.getDocument.

Returns opened document

Returns:SlideShow<S, P>

the opened document

Annotations
@Override
getFilesystemback to summary
public SlideShow<S, P> getFilesystem()

Implements org.apache.poi.extractor.POITextExtractor.getFilesystem.

Returns:SlideShow<S, P>

Doc from org.apache.poi.extractor.POITextExtractor.getFilesystem.

The underlying resources/filesystem

Annotations
@Override
getMetadataTextExtractorback to summary
public POITextExtractor getMetadataTextExtractor()

Implements org.apache.poi.extractor.POITextExtractor.getMetadataTextExtractor.

Doc from org.apache.poi.extractor.POITextExtractor.getMetadataTextExtractor.

Returns another text extractor, which is able to output the textual content of the document metadata / properties, such as author and title.

Returns:POITextExtractor

the metadata and text extractor

Annotations
@Override
getOLEShapesback to summary
public List<? extends ObjectShape<S, P>> getOLEShapes()
getTextback to summary
public String getText()

Implements org.apache.poi.extractor.POITextExtractor.getText.

Fetches all the slide text from the slideshow, but not the notes, unless you've called setSlidesByDefault() and setNotesByDefault() to change this

Returns:String

Doc from org.apache.poi.extractor.POITextExtractor.getText.

All the text from the document

Annotations
@Override
getTextback to summary
public String getText(final Slide<S, P> slide)
getTextback to summary
private void getText(final Slide<S, P> slide, final Consumer<String> consumer)
isCloseFilesystemback to summary
public boolean isCloseFilesystem()

Implements org.apache.poi.extractor.POITextExtractor.isCloseFilesystem.

Returns:boolean

Doc from org.apache.poi.extractor.POITextExtractor.isCloseFilesystem.

true, if resources/filesystem should be closed on close()

Annotations
@Override
printCommentsback to summary
private void printComments(final Slide<S, P> slide, final Consumer<String> consumer)
printHeaderFooterback to summary
private void printHeaderFooter(final Sheet<S, P> sheet, final Consumer<String> consumer, final Consumer<String> footerCon)
printNotesback to summary
private void printNotes(final Slide<S, P> slide, final Consumer<String> consumer)
printShapeTextback to summary
private void printShapeText(final Sheet<S, P> sheet, final Consumer<String> consumer)
printShapeTextback to summary
private void printShapeText(final ShapeContainer<S, P> container, final Consumer<String> consumer)
Annotations
@SuppressWarnings:unchecked
printShapeTextback to summary
private void printShapeText(final TableShape<S, P> shape, final Consumer<String> consumer)
Annotations
@SuppressWarnings:Duplicates
printSlideMasterback to summary
private void printSlideMaster(final MasterSheet<S, P> master, final Consumer<String> consumer)
printTextParagraphsback to summary
private void printTextParagraphs(final List<P> paras, final Consumer<String> consumer)
printTextParagraphsback to summary
private void printTextParagraphs(final List<P> paras, final Consumer<String> consumer, String trailer)
printTextParagraphsback to summary
private void printTextParagraphs(final List<P> paras, final Consumer<String> consumer, String trailer, final Function<TextRun, String> converter)
replaceSlideNumberback to summary
private static String replaceSlideNumber(TextRun tr)
replaceTextCapback to summary
private static String replaceTextCap(TextRun tr)
setCloseFilesystemback to summary
public void setCloseFilesystem(boolean doCloseFilesystem)

Implements org.apache.poi.extractor.POITextExtractor.setCloseFilesystem.

Parameters
doCloseFilesystem:boolean

Doc from org.apache.poi.extractor.POITextExtractor.setCloseFilesystem.

true (default), if underlying resources/filesystem should be closed on close()

Annotations
@Override
setCommentsByDefaultback to summary
public void setCommentsByDefault(final boolean commentsByDefault)

Should a call to getText() return comments text? Default is no

setMasterByDefaultback to summary
public void setMasterByDefault(final boolean masterByDefault)

Should a call to getText() return text from master? Default is no

setNotesByDefaultback to summary
public void setNotesByDefault(final boolean notesByDefault)

Should a call to getText() return notes text? Default is no

setSlidesByDefaultback to summary
public void setSlidesByDefault(final boolean slidesByDefault)

Should a call to getText() return slide text? Default is yes