Class SearchAction
java.lang.Object
com.itextpdf.pdfoptimizer.util.traversing.SearchAction
- All Implemented Interfaces:
-
IAction
Collects all objects matches the provided predicate.
-
Constructor Summary
ConstructorDescriptionSearchAction
(IPdfObjectPredicate predicate) Creates a new instance of searching action. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves objects found in structure of somePdfDocument
with use ofDocumentStructureUtils.traverse(PdfDocument, IAction)
.void
processIndirectObjectDefinition
(com.itextpdf.kernel.pdf.PdfObject object) Evaluates this predicate on the given indirectPdfObject
definition and adds it to search results if object matches the condition.com.itextpdf.kernel.pdf.PdfObject
processObject
(com.itextpdf.kernel.pdf.PdfObject object) Evaluates this predicate on the givenPdfObject
and 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 somePdfDocument
with 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 indirectPdfObject
definition and adds it to search results if object matches the condition.- Specified by:
-
processIndirectObjectDefinition
in 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 givenPdfObject
and adds it to search results if object matches the condition.- Specified by:
-
processObject
in 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
-