com.etymon.pjx.util
Class PdfReferencedObjects

java.lang.Object
  extended by com.etymon.pjx.util.PdfReferencedObjects
All Implemented Interfaces:
PdfObjectFilter
Direct Known Subclasses:
PdfPageObjects

public class PdfReferencedObjects
extends java.lang.Object
implements PdfObjectFilter

Examines a specified object and returns the set of all objects it references. This class implements the PdfObjectFilter interface. The preFilter(PdfObject) method can be overridden in a subclass to pre-process the object and its contents. This class is synchronized.


Field Summary
protected  PdfManager _m
          The manager to use for resolving references.
protected  java.util.Set _ref
          The current set of referenced objects (stored as indirect references).
protected  java.util.Set _ref_master
          The total set of referenced objects (stored as indirect references).
 
Constructor Summary
PdfReferencedObjects(PdfManager manager)
          Constructs a PdfReferencedObjects instance.
 
Method Summary
 java.util.Set getReferenced(PdfObject obj)
          Returns the set of all objects referenced by the specified PDF object.
 PdfObject postFilter(PdfObject obj)
          This method is used by getReferenced(PdfObject) and should not be called externally.
 PdfObject preFilter(PdfObject obj)
          This method is used by getReferenced(PdfObject) and should not be called externally; however, it may be overridden in subclasses in order to pre-process the objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_ref_master

protected java.util.Set _ref_master
The total set of referenced objects (stored as indirect references).


_ref

protected java.util.Set _ref
The current set of referenced objects (stored as indirect references).


_m

protected PdfManager _m
The manager to use for resolving references.

Constructor Detail

PdfReferencedObjects

public PdfReferencedObjects(PdfManager manager)
Constructs a PdfReferencedObjects instance.

Parameters:
manager - the manager associated with the document.
Method Detail

getReferenced

public java.util.Set getReferenced(PdfObject obj)
                            throws java.io.IOException,
                                   PdfFormatException
Returns the set of all objects referenced by the specified PDF object. This method calls PdfObject.filter(PdfObjectFilter) to process objects recursively.

Parameters:
obj - the object to examine.
Throws:
PdfFormatException
java.io.IOException

preFilter

public PdfObject preFilter(PdfObject obj)
                    throws PdfFormatException
This method is used by getReferenced(PdfObject) and should not be called externally; however, it may be overridden in subclasses in order to pre-process the objects. (It is not synchronized.)

Specified by:
preFilter in interface PdfObjectFilter
Parameters:
obj - the object to filter.
Returns:
the filtered object.
Throws:
PdfFormatException

postFilter

public PdfObject postFilter(PdfObject obj)
                     throws PdfFormatException
This method is used by getReferenced(PdfObject) and should not be called externally. (It is not synchronized.)

Specified by:
postFilter in interface PdfObjectFilter
Parameters:
obj - the object to filter.
Returns:
the filtered object.
Throws:
PdfFormatException