Class FilteredTextEventListener
java.lang.Object
com.itextpdf.kernel.pdf.canvas.parser.listener.FilteredEventListener
com.itextpdf.kernel.pdf.canvas.parser.listener.FilteredTextEventListener
- All Implemented Interfaces:
-
IEventListener
,ITextExtractionStrategy
public class FilteredTextEventListener extends FilteredEventListener implements ITextExtractionStrategy
A text event listener which filters events on the fly before passing them on to the delegate. The only difference from
FilteredEventListener
is that this class conveniently implements ITextExtractionStrategy
and can therefore used as a strategy on its own, apart from the inherited function of filtering event appropriately to its delegates.
-
Field Summary
Fields inherited from class com.itextpdf.kernel.pdf.canvas.parser.listener.FilteredEventListener
delegates, filters
-
Constructor Summary
ConstructorDescriptionFilteredTextEventListener
(ITextExtractionStrategy delegate, IEventFilter... filterSet) Constructs aFilteredTextEventListener
instance with aITextExtractionStrategy
delegate. -
Method Summary
Modifier and TypeMethodDescriptionAs an resultant text we use the concatenation of all the resultant text of all the delegates that implementITextExtractionStrategy
.Methods inherited from class com.itextpdf.kernel.pdf.canvas.parser.listener.FilteredEventListener
attachEventListener, eventOccurred, getSupportedEvents
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.itextpdf.kernel.pdf.canvas.parser.listener.IEventListener
eventOccurred, getSupportedEvents
-
Constructor Details
-
FilteredTextEventListener
Constructs aFilteredTextEventListener
instance with aITextExtractionStrategy
delegate.- Parameters:
-
delegate
- a delegate that fill be called when all the corresponding filters for an event pass -
filterSet
- filters attached to the delegate that will be tested before passing an event on to the delegate
-
-
Method Details
-
getResultantText
As an resultant text we use the concatenation of all the resultant text of all the delegates that implementITextExtractionStrategy
.- Specified by:
-
getResultantText
in interfaceITextExtractionStrategy
- Returns:
- the resulting concatenation of the text extracted from the delegates
-