public class BookmarkValidationProcess extends AbstractProcess
Constructor and Description |
---|
BookmarkValidationProcess() |
Modifier and Type | Method and Description |
---|---|
private boolean |
checkIndirectObject(PreflightContext ctx,
COSDictionary dictionary,
COSName name) |
private boolean |
checkIndirectObjects(PreflightContext ctx,
COSDictionary dictionary) |
protected boolean |
exploreOutlineLevel(PreflightContext ctx,
PDOutlineItem inputItem,
COSObject firstObj,
COSObject lastObj)
This method explores the Outline Item Level and calls a validation method on each Outline Item.
|
private boolean |
isCountEntryPositive(PreflightContext ctx,
COSDictionary outline)
return true if Count entry > 0
|
private boolean |
isCountEntryPresent(COSDictionary outline)
Return true if the Count entry is present in the given dictionary.
|
private COSObject |
toCOSObject(COSBase base)
Returns a COSBase as a COSObject or null if null or COSNull.
|
void |
validate(PreflightContext ctx) |
protected boolean |
validateItem(PreflightContext ctx,
PDOutlineItem inputItem)
This method checks the inputItem dictionary and call the exploreOutlineLevel method on the first child if it is
not null.
|
addFontError, addValidationError, addValidationErrors
public void validate(PreflightContext ctx) throws ValidationException
ValidationException
private boolean isCountEntryPresent(COSDictionary outline)
outline
- the dictionary representing the document outline.private boolean isCountEntryPositive(PreflightContext ctx, COSDictionary outline)
ctx
- the preflight context.outline
- the dictionary representing the document outline.protected boolean exploreOutlineLevel(PreflightContext ctx, PDOutlineItem inputItem, COSObject firstObj, COSObject lastObj) throws ValidationException
ctx
- the preflight context.inputItem
- The first outline item of the level.firstObj
- The first PDF object of the level.lastObj
- The last PDF object of the level.ValidationException
protected boolean validateItem(PreflightContext ctx, PDOutlineItem inputItem) throws ValidationException
ctx
- the preflight context.inputItem
- outline item to validateValidationException
private boolean checkIndirectObjects(PreflightContext ctx, COSDictionary dictionary)
private boolean checkIndirectObject(PreflightContext ctx, COSDictionary dictionary, COSName name)
private COSObject toCOSObject(COSBase base)
checkIndirectObjects(PreflightContext, COSDictionary)
.base
- should be null, COSNull or a COSObject.java.lang.IllegalArgumentException
- if the parameter is not null, COSNull or
a COSObject.