com.etymon.pjx
Interface PdfObjectFilter

All Known Implementing Classes:
PdfPageObjects, PdfReferencedObjects, PdfRenumberOffset

public interface PdfObjectFilter

A filtering function that allows examining and modifying PDF objects recursively. PdfObject.filter(PdfObjectFilter) passes each object through preFilter(PdfObject) before descending recursively into the object's contents (if it is a container such as PdfArray or PdfDictionary). It then passes the (possibly modified) object through postFilter(PdfObject) for a second opportunity to examine or modify the object. The modified object is not required to be of the same type as the original object.


Method Summary
 PdfObject postFilter(PdfObject obj)
          Examines a PDF object and optionally returns a modified object.
 PdfObject preFilter(PdfObject obj)
          Examines a PDF object and optionally returns a modified object.
 

Method Detail

preFilter

PdfObject preFilter(PdfObject obj)
                    throws PdfFormatException
Examines a PDF object and optionally returns a modified object. This method should return the original object or a modified replacement. If no modifications are desired, it should return the original object. This method may also return null in order to discard the object; however, this will cause postFilter(PdfObject) to be called with a null value as its parameter. A PdfArray or PdfDictionary object is considered to be a container, and this method filters the container as a whole before filtering each element within it (assuming the elements are still present in the modified object). When this method receives a container, that container's contents will not yet have been filtered by this method.

Parameters:
obj - the object to examine.
Returns:
the "filtered" object.
Throws:
PdfFormatException

postFilter

PdfObject postFilter(PdfObject obj)
                     throws PdfFormatException
Examines a PDF object and optionally returns a modified object. This method should return the original object or a modified replacement. If no modifications are desired, it should return the original object. This method may also return null in order to discard the object. A PdfArray or PdfDictionary object is considered to be a container, and this method filters each element within it before filtering the container as a whole. When this method receives a container, that container's contents will have already been filtered by this method.

Parameters:
obj - the object to examine.
Returns:
the "filtered" object.
Throws:
PdfFormatException