edu.harvard.hul.ois.jhove.module.pdf
Class Destination

java.lang.Object
  extended by edu.harvard.hul.ois.jhove.module.pdf.Destination

public final class Destination
extends java.lang.Object

Class encapsulating PDF destination objects, which refer to a page in the document. We need to make two different kinds of distinctions: between destinations that make an indirect and a direct reference to a page; and between destinations that have been reached by a direct and an indirect reference. The PDF spec allows only one level of indirection, so each of these forms has options not available to the other. We call a destination which has been reached directly an unnamed destination, and one which has been reached indirectly a named destination. We call a destination which has an indirect target an indirect destination, and one which has a page object as a target a direct destination. Applying the PDF documentation, we find that a destination can never be both named and indirect. In other words, there are really two cases, involving three kinds of destinations:


Constructor Summary
Destination(PdfObject destObj, PdfModule module, boolean named)
          Constructor.
 
Method Summary
 PdfSimpleObject getIndirectDest()
          Returns the string naming the indirect destination.
 PdfDictionary getPageDest()
          Returns the page object dictionary if the destination is direct.
 int getPageDestObjNumber()
          Returns the object number of the page object dictionary if the destination is direct.
 boolean isIndirect()
          Returns true if the destination is indirect.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Destination

public Destination(PdfObject destObj,
                   PdfModule module,
                   boolean named)
            throws PdfException
Constructor. If this is a named destination, the destObj may be a PdfArray or a PdfDictionary; if this is not a named destination, the destObj may be a PdfSimpleObject (encapsulating a Literal or Name) or a PdfDictionary.

Parameters:
destObj - The destination object
module - The invoking PdfModule
named - Flag indicating whether this object came from a named destination.
Throws:
PdfException
Method Detail

isIndirect

public boolean isIndirect()
Returns true if the destination is indirect.


getIndirectDest

public PdfSimpleObject getIndirectDest()
Returns the string naming the indirect destination. Returns null if the destination is not indirect.


getPageDest

public PdfDictionary getPageDest()
Returns the page object dictionary if the destination is direct. Returns null if the destination is not direct.


getPageDestObjNumber

public int getPageDestObjNumber()
                         throws java.lang.NullPointerException
Returns the object number of the page object dictionary if the destination is direct. Throws a NullPointerException otherwise.

Throws:
java.lang.NullPointerException