Class SearchAction

java.lang.Object
com.itextpdf.pdfoptimizer.util.traversing.SearchAction
All Implemented Interfaces:
IAction

public class SearchAction extends Object implements IAction
Collects all objects matches the provided predicate.
  • Constructor Details

    • SearchAction

      public SearchAction (IPdfObjectPredicate predicate)
      Creates a new instance of searching action.
      Parameters:
      predicate - is a criteria for search
  • Method Details

    • getFoundObjects

      public List getFoundObjects()
      Retrieves objects found in structure of some PdfDocument with use of DocumentStructureUtils.traverse(PdfDocument, IAction).
      Returns:
      list of found objects
    • processIndirectObjectDefinition

      public void processIndirectObjectDefinition (com.itextpdf.kernel.pdf.PdfObject object)
      Evaluates this predicate on the given indirect PdfObject definition and adds it to search results if object matches the condition.
      Specified by:
      processIndirectObjectDefinition in interface IAction
      Parameters:
      object - is an indirect object to process
    • processObject

      public com.itextpdf.kernel.pdf.PdfObject processObject (com.itextpdf.kernel.pdf.PdfObject object)
      Evaluates this predicate on the given PdfObject and adds it to search results if object matches the condition.
      Specified by:
      processObject in interface IAction
      Parameters:
      object - is an direct object to process
      Returns:
      an object that should replace current one. Can be the same instance as argument to avoid replacement