Class RegexBasedCleanupStrategy
java.lang.Object
com.itextpdf.kernel.pdf.canvas.parser.listener.RegexBasedLocationExtractionStrategy
com.itextpdf.pdfcleanup.autosweep.RegexBasedCleanupStrategy
- All Implemented Interfaces:
-
com.itextpdf.kernel.pdf.canvas.parser.listener.IEventListener,com.itextpdf.kernel.pdf.canvas.parser.listener.ILocationExtractionStrategy,ICleanupStrategy
public class RegexBasedCleanupStrategy extends com.itextpdf.kernel.pdf.canvas.parser.listener.RegexBasedLocationExtractionStrategy implements ICleanupStrategy
This class represents a regular expression based cleanup strategy
-
Constructor Summary
ConstructorsConstructorDescriptionRegexBasedCleanupStrategy(String regex) Creates an object of regular expression based cleanup strategy.RegexBasedCleanupStrategy(Pattern pattern) Creates an object of regular expression based cleanup strategy. -
Method Summary
Modifier and TypeMethodDescriptioncom.itextpdf.kernel.colors.ColorgetRedactionColor(com.itextpdf.kernel.pdf.canvas.parser.listener.IPdfTextLocation location) Get the color in which redaction is to take placereset()Returns anICleanupStrategyobject which is set to this regular pattern and redaction color.setRedactionColor(com.itextpdf.kernel.colors.Color color) Sets the color in which redaction is to take place.Methods inherited from class com.itextpdf.kernel.pdf.canvas.parser.listener.RegexBasedLocationExtractionStrategy
eventOccurred, getResultantLocations, getSupportedEvents, toCRI, toRectanglesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.itextpdf.kernel.pdf.canvas.parser.listener.IEventListener
eventOccurred, getSupportedEventsMethods inherited from interface com.itextpdf.kernel.pdf.canvas.parser.listener.ILocationExtractionStrategy
getResultantLocations
-
Constructor Details
-
RegexBasedCleanupStrategy
Creates an object of regular expression based cleanup strategy.- Parameters:
-
regex- regular expression on which cleanup strategy will be based
-
RegexBasedCleanupStrategy
Creates an object of regular expression based cleanup strategy.- Parameters:
-
pattern-Patternpattern on which cleanup strategy will be based
-
-
Method Details
-
getRedactionColor
public com.itextpdf.kernel.colors.Color getRedactionColor(com.itextpdf.kernel.pdf.canvas.parser.listener.IPdfTextLocation location) Get the color in which redaction is to take place- Specified by:
-
getRedactionColorin interfaceICleanupStrategy - Parameters:
-
location- where to get the redaction color from - Returns:
-
a
Color
-
setRedactionColor
Sets the color in which redaction is to take place.- Parameters:
-
color- the color in which redaction is to take place - Returns:
-
this
strategy
-
reset
Returns anICleanupStrategyobject which is set to this regular pattern and redaction color.- Specified by:
-
resetin interfaceICleanupStrategy - Returns:
-
a reset
cleanup strategy
-