Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## edu.harvard.hul.ois.jhove.module.pdf
Class PdfProfile

    java.lang.Object
      edu.harvard.hul.ois.jhove.module.pdf.PdfProfile

Direct Known Subclasses:
  AProfile, AProfileLevelA, LinearizedProfile, TaggedProfile, XProfileBase

    public abstract class PdfProfile

extends java.lang.Object

Abstract class for PDF profile checkers.

Field Summary
`protected PdfModule` | `_module` The module invoking this profile.
`protected Parser` | `_parser` The Parser being used on the file.
`protected java.lang.String` | `_profileText` A brief human-readable description of the profile.
`protected java.io.RandomAccessFile` | `_raf` The file being analyzed.

Constructor Summary
`PdfProfile(PdfModule module)` Creates a PdfProfile.

Method Summary
`java.lang.String` | `getText()` Returns the text which describes this profile.
`protected boolean` | `hasFilters(PdfObject filter, java.lang.String[] names)` Returns `true` if a Filter object contains a filter name which matches any of the Strings in the second argument.
`boolean` | `isAlreadyOK()` Returns the value of the alreadyOK flag.
`boolean` | `satisfiesProfile(java.io.RandomAccessFile raf, Parser parser)` Returns `true` if the document satisfies the profile.
`abstract boolean` | `satisfiesThisProfile()` Returns `true` if the document satisfies the profile.
`protected boolean` | `xObjectOK(PdfDictionary xo)` Checks a single XObject for xObjectsOK.
`protected boolean` | `xObjectsOK(PdfDictionary xos)` This checks the "XObjects" dictionary, which is a dictionary whose entries have values that are XObjects.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### _module

    protected PdfModule _module

  The module invoking this profile.

### _profileText

    protected java.lang.String _profileText

  A brief human-readable description of the profile.

### _parser

    protected Parser _parser

  The Parser being used on the file.

### _raf

    protected java.io.RandomAccessFile _raf

  The file being analyzed.

Constructor Detail

### PdfProfile

    public PdfProfile(PdfModule module)

  Creates a PdfProfile. Subclass constructors should call the super constructor, then assign a value to _profileText.

  Parameters:
    `module` - The PDFModule we're working under

Method Detail

### isAlreadyOK

    public boolean isAlreadyOK()

  Returns the value of the alreadyOK flag. This flag when one profile depends on another, to save redundant checking. The alreadyOK flag is set whenever satisfiesProfile returns `true`.

### satisfiesProfile

    public final boolean satisfiesProfile(java.io.RandomAccessFile raf,
                                          Parser parser)

  Returns `true` if the document satisfies the profile. This calls `satisfiesThisProfile()`, which does the actual work.

  Parameters:
    `raf` - The RandomAccessFile being parsed
    `parser` - The Parser being used on the file

### satisfiesThisProfile

    public abstract boolean satisfiesThisProfile()

  Returns `true` if the document satisfies the profile. Subclasses should override `satisfiesThisProfile()`, not `satisfiesProfile()`, as `satisfiesProfile()` does some additional bookkeeping for all subclases.

### getText

    public java.lang.String getText()

  Returns the text which describes this profile.

### hasFilters

    protected boolean hasFilters(PdfObject filter,
                                 java.lang.String[] names)

  Returns `true` if a Filter object contains a filter name which matches any of the Strings in the second argument. Will return false if a PdfException is thrown due to an unexpected data type. (Note 24-Feb-04: This was returning false if any filter matched, but that's contrary to both the sense conveyed by the name and the way it's being called. Was there a reason it was that way?)

  Parameters:
    `filter` - A PdfObject which may be either a PdfSimpleObject encapsulating a Name, or a PdfArray of such objects. If a null value is passed, it doesn't match any filter, so `false` is returned.
    `names` - An array of Strings naming the filters which should precipitate a true result

### xObjectsOK

    protected boolean xObjectsOK(PdfDictionary xos)

  This checks the "XObjects" dictionary, which is a dictionary whose entries have values that are XObjects. Override xObjectOK to implement profile-specific behavior.

### xObjectOK

    protected boolean xObjectOK(PdfDictionary xo)

  Checks a single XObject for xObjectsOK. Always returns `true`. Override to implement tests.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD