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
ConstructorDescriptionRegexBasedCleanupStrategy
(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.Color
getRedactionColor
(com.itextpdf.kernel.pdf.canvas.parser.listener.IPdfTextLocation location) Get the color in which redaction is to take placereset()
Returns anICleanupStrategy
object 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, toRectangles
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
Methods 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
-Pattern
pattern 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:
-
getRedactionColor
in 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 anICleanupStrategy
object which is set to this regular pattern and redaction color.- Specified by:
-
reset
in interfaceICleanupStrategy
- Returns:
-
a reset
cleanup strategy
-