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 fromFilteredEventListener
is that this class conveniently implementsITextExtractionStrategy
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
Constructors Constructor Description FilteredTextEventListener(ITextExtractionStrategy delegate, IEventFilter... filterSet)
Constructs aFilteredTextEventListener
instance with aITextExtractionStrategy
delegate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getResultantText()
As 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 Detail
-
FilteredTextEventListener
public FilteredTextEventListener(ITextExtractionStrategy delegate, IEventFilter... filterSet)
Constructs aFilteredTextEventListener
instance with aITextExtractionStrategy
delegate.- Parameters:
delegate
- a delegate that fill be called when all the corresponding filters for an event passfilterSet
- filters attached to the delegate that will be tested before passing an event on to the delegate
-
-
Method Detail
-
getResultantText
public java.lang.String 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
-
-