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

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

public class StructureTree
extends java.lang.Object

Class for PDF document structure tree. See section 9.6, "Logical Structure," of PDF Reference, Version 1.4, for an explanation of the document structure.

See Also:
StructureElement

Constructor Summary
StructureTree(PdfModule module, java.io.RandomAccessFile raf, Parser parser)
          Constructor.
 
Method Summary
 java.lang.String dereferenceStructType(java.lang.String st)
          Dereference a name in the role map.
 PdfModule getModule()
          Returns the module associated with this object.
 boolean isPresent()
          Returns true if and only if the document structure exists.
 boolean isValid()
          Returns true if and only if no errors were detected.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StructureTree

public StructureTree(PdfModule module,
                     java.io.RandomAccessFile raf,
                     Parser parser)
              throws PdfException
Constructor. If there is a document structure tree, this fills in the appropriate information. If there isn't, it does nothing. Call isPresent() to determine whether there is a document structure tree. A PdfInvalidException may be thrown if there is a structure tree but it is invalid.

Parameters:
module - The PdfModule under which we're operating
raf - The document file object
parser - The Parser being used
Throws:
PdfException
Method Detail

isPresent

public boolean isPresent()
Returns true if and only if the document structure exists.


isValid

public boolean isValid()
Returns true if and only if no errors were detected.


getModule

public PdfModule getModule()
Returns the module associated with this object.


dereferenceStructType

public java.lang.String dereferenceStructType(java.lang.String st)
Dereference a name in the role map. If there is no role map, or if the parameter is not mapped by the role map, the original parameter will be returned. The string will be looked up through multiple levels in the role map. The maximum number of levels is limited to 50, in case of circular mappings. The value returned will be null if the role map contains invalid data or the limit of 50 lookups is reached.