Class CompositeCleanupStrategy

java.lang.Object
com.itextpdf.pdfcleanup.autosweep.CompositeCleanupStrategy
All Implemented Interfaces:
com.itextpdf.kernel.pdf.canvas.parser.listener.IEventListener, com.itextpdf.kernel.pdf.canvas.parser.listener.ILocationExtractionStrategy, ICleanupStrategy

public class CompositeCleanupStrategy extends Object implements ICleanupStrategy
This class is a composite pattern for ICleanupStrategy. It allows users to have multiple ICleanupStrategy implementations and bundle them as one.
  • Constructor Details

  • Method Details

    • add

      public void add (ICleanupStrategy strategy)
      Parameters:
      strategy - a cleanup strategy to be added to this composite pattern.
    • getResultantLocations

      public Collection getResultantLocations()
      Specified by:
      getResultantLocations in interface com.itextpdf.kernel.pdf.canvas.parser.listener.ILocationExtractionStrategy
    • 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
    • eventOccurred

      public void eventOccurred (com.itextpdf.kernel.pdf.canvas.parser.data.IEventData data, com.itextpdf.kernel.pdf.canvas.parser.EventType type)
      Specified by:
      eventOccurred in interface com.itextpdf.kernel.pdf.canvas.parser.listener.IEventListener
    • getSupportedEvents

      public Set getSupportedEvents()
      Specified by:
      getSupportedEvents in interface com.itextpdf.kernel.pdf.canvas.parser.listener.IEventListener
    • reset

      public ICleanupStrategy reset()
      Returns a cleanup strategy which represents a reset composite cleanup strategy.

      Note that all the inner strategies will be reset as well.

      Specified by:
      reset in interface ICleanupStrategy
      Returns:
      a reset composite strategy