Top Constructors Methods
org.apache.pdfbox.preflight.process

public Class BookmarkValidationProcess

extends AbstractProcess
Class Inheritance
Imports
java.util.HashSet, .Set, org.apache.pdfbox.cos.COSBase, .COSDictionary, .COSInteger, .COSName, .COSNull, .COSObject, org.apache.pdfbox.pdmodel.PDDocumentCatalog, org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDDocumentOutline, .PDOutlineItem, org.apache.pdfbox.preflight.PreflightContext, .ValidationResult.ValidationError, org.apache.pdfbox.preflight.exception.ValidationException, org.apache.pdfbox.preflight.utils.ContextHelper

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private boolean
private boolean
protected boolean

Returns:

true if all items are valid in this level.
exploreOutlineLevel
(PreflightContext
the preflight context.
ctx
,
PDOutlineItem
The first outline item of the level.
inputItem
,
COSObject
The first PDF object of the level.
firstObj
,
COSObject
The last PDF object of the level.
lastObj
)

This method explores the Outline Item Level and calls a validation method on each Outline Item.

private boolean

Returns:

true if the Count entry > 0.
isCountEntryPositive
(COSDictionary
the dictionary representing the document outline.
outline
)

return true if Count entry > 0

private boolean

Returns:

true if the Count entry is present.
isCountEntryPresent
(COSDictionary
the dictionary representing the document outline.
outline
)

Return true if the Count entry is present in the given dictionary.

private COSObject

Returns:

null if the parameter is COSNull or null; or else a COSObject.
toCOSObject
(COSBase
should be null, COSNull or a COSObject.
base
)

Returns a COSBase as a COSObject or null if null or COSNull.

public void
protected boolean

Returns:

the validation result.
validateItem
(PreflightContext
the preflight context.
ctx
,
PDOutlineItem
outline item to validate
inputItem
)

This method checks the inputItem dictionary and call the exploreOutlineLevel method on the first child if it is not null.

Inherited from org.apache.pdfbox.preflight.process.AbstractProcess:
addFontErroraddValidationErroraddValidationErrors

Constructor Detail

BookmarkValidationProcessback to summary
public BookmarkValidationProcess()

Method Detail

checkIndirectObjectback to summary
private boolean checkIndirectObject(PreflightContext ctx, COSDictionary dictionary, COSName name)
checkIndirectObjectsback to summary
private boolean checkIndirectObjects(PreflightContext ctx, COSDictionary dictionary)
exploreOutlineLevelback to summary
protected boolean exploreOutlineLevel(PreflightContext ctx, PDOutlineItem inputItem, COSObject firstObj, COSObject lastObj) throws ValidationException

This method explores the Outline Item Level and calls a validation method on each Outline Item. If an invalid outline item is found, the result list is updated.

Parameters
ctx:PreflightContext

the preflight context.

inputItem:PDOutlineItem

The first outline item of the level.

firstObj:COSObject

The first PDF object of the level.

lastObj:COSObject

The last PDF object of the level.

Returns:boolean

true if all items are valid in this level.

isCountEntryPositiveback to summary
private boolean isCountEntryPositive(COSDictionary outline)

return true if Count entry > 0

Parameters
outline:COSDictionary

the dictionary representing the document outline.

Returns:boolean

true if the Count entry > 0.

isCountEntryPresentback to summary
private boolean isCountEntryPresent(COSDictionary outline)

Return true if the Count entry is present in the given dictionary.

Parameters
outline:COSDictionary

the dictionary representing the document outline.

Returns:boolean

true if the Count entry is present.

toCOSObjectback to summary
private COSObject toCOSObject(COSBase base)

Returns a COSBase as a COSObject or null if null or COSNull. To avoid trouble, this method is to be called only after having called checkIndirectObjects(PreflightContext, COSDictionary).

Parameters
base:COSBase

should be null, COSNull or a COSObject.

Returns:COSObject

null if the parameter is COSNull or null; or else a COSObject.

Exceptions
IllegalArgumentException:
if the parameter is not null, COSNull or a COSObject.
validateback to summary
public void validate(PreflightContext ctx) throws ValidationException

Implements org.apache.pdfbox.preflight.process.ValidationProcess.validate.

Annotations
@Override
validateItemback to summary
protected boolean validateItem(PreflightContext ctx, PDOutlineItem inputItem) throws ValidationException

This method checks the inputItem dictionary and call the exploreOutlineLevel method on the first child if it is not null.

Parameters
ctx:PreflightContext

the preflight context.

inputItem:PDOutlineItem

outline item to validate

Returns:boolean

the validation result.