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

    Constructors
    Constructor
    Description
    Creates an object of regular expression based cleanup strategy.
    Creates an object of regular expression based cleanup strategy.
  • Method Summary

    Modifier and Type
    Method
    Description
    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
    reset()
    Returns an ICleanupStrategy 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

      public RegexBasedCleanupStrategy (String regex)
      Creates an object of regular expression based cleanup strategy.
      Parameters:
      regex - regular expression on which cleanup strategy will be based
    • RegexBasedCleanupStrategy

      public RegexBasedCleanupStrategy (Pattern pattern)
      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 interface ICleanupStrategy
      Parameters:
      location - where to get the redaction color from
      Returns:
      a Color
    • setRedactionColor

      public RegexBasedCleanupStrategy setRedactionColor (com.itextpdf.kernel.colors.Color color)
      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

      public ICleanupStrategy reset()
      Returns an ICleanupStrategy object which is set to this regular pattern and redaction color.
      Specified by:
      reset in interface ICleanupStrategy
      Returns:
      a reset cleanup strategy