public abstract class PdfProfile extends Object
Modifier and Type | Field and Description |
---|---|
protected PdfModule |
_module
The module invoking this profile.
|
protected Parser |
_parser
The Parser being used on the file.
|
protected String |
_profileText
A brief human-readable description of the profile.
|
protected RandomAccessFile |
_raf
The file being analyzed.
|
Constructor and Description |
---|
PdfProfile(PdfModule module)
Creates a PdfProfile.
|
Modifier and Type | Method and Description |
---|---|
String |
getText()
Returns the text which describes this profile.
|
protected boolean |
hasFilters(PdfObject filter,
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(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.
|
protected PdfModule _module
protected String _profileText
protected Parser _parser
protected RandomAccessFile _raf
public PdfProfile(PdfModule module)
module
- The PDFModule we're working underpublic boolean isAlreadyOK()
true
.public final boolean satisfiesProfile(RandomAccessFile raf, Parser parser)
true
if the document satisfies the profile.
This calls satisfiesThisProfile()
, which does the actual work.raf
- The RandomAccessFile being parsedparser
- The Parser being used on the filepublic abstract boolean satisfiesThisProfile()
true
if the document satisfies the
profile. Subclasses should override satisfiesThisProfile()
,
not satisfiesProfile()
, as
satisfiesProfile()
does some
additional bookkeeping for all subclases.public String getText()
protected boolean hasFilters(PdfObject filter, String[] names)
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?)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 resultprotected boolean xObjectsOK(PdfDictionary xos)
protected boolean xObjectOK(PdfDictionary xo)
true
.
Override to implement tests.Copyright © 2008–2017 The Open Preservation Foundation. All rights reserved.