Class SearchAction
java.lang.Object
com.itextpdf.pdfoptimizer.util.traversing.SearchAction
- All Implemented Interfaces:
-
IAction
Collects all objects matches the provided predicate.
-
Constructor Summary
ConstructorsConstructorDescriptionSearchAction(IPdfObjectPredicate predicate) Creates a new instance of searching action. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves objects found in structure of somePdfDocumentwith use ofDocumentStructureUtils.traverse(PdfDocument, IAction).voidprocessIndirectObjectDefinition(com.itextpdf.kernel.pdf.PdfObject object) Evaluates this predicate on the given indirectPdfObjectdefinition and adds it to search results if object matches the condition.com.itextpdf.kernel.pdf.PdfObjectprocessObject(com.itextpdf.kernel.pdf.PdfObject object) Evaluates this predicate on the givenPdfObjectand adds it to search results if object matches the condition.
-
Constructor Details
-
SearchAction
Creates a new instance of searching action.- Parameters:
-
predicate- is a criteria for search
-
-
Method Details
-
getFoundObjects
Retrieves objects found in structure of somePdfDocumentwith use ofDocumentStructureUtils.traverse(PdfDocument, IAction).- Returns:
- list of found objects
-
processIndirectObjectDefinition
public void processIndirectObjectDefinition(com.itextpdf.kernel.pdf.PdfObject object) Evaluates this predicate on the given indirectPdfObjectdefinition and adds it to search results if object matches the condition.- Specified by:
-
processIndirectObjectDefinitionin interfaceIAction - 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 givenPdfObjectand adds it to search results if object matches the condition.- Specified by:
-
processObjectin interfaceIAction - 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
-