Class BookmarkValidationProcess
java.lang.Object
org.apache.pdfbox.preflight.process.AbstractProcess
org.apache.pdfbox.preflight.process.BookmarkValidationProcess
- All Implemented Interfaces:
ValidationProcess
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate booleancheckIndirectObject(PreflightContext ctx, COSDictionary dictionary, COSName name) private booleancheckIndirectObjects(PreflightContext ctx, COSDictionary dictionary) protected booleanexploreOutlineLevel(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 booleanisCountEntryPositive(PreflightContext ctx, COSDictionary outline) return true if Count entry > 0private booleanisCountEntryPresent(COSDictionary outline) Return true if the Count entry is present in the given dictionary.private COSObjecttoCOSObject(COSBase base) Returns a COSBase as a COSObject or null if null or COSNull.voidvalidate(PreflightContext ctx) protected booleanvalidateItem(PreflightContext ctx, PDOutlineItem inputItem) This method checks the inputItem dictionary and call the exploreOutlineLevel method on the first child if it is not null.Methods inherited from class org.apache.pdfbox.preflight.process.AbstractProcess
addFontError, addValidationError, addValidationErrors
-
Constructor Details
-
BookmarkValidationProcess
public BookmarkValidationProcess()
-
-
Method Details
-
validate
- Throws:
ValidationException
-
isCountEntryPresent
Return true if the Count entry is present in the given dictionary.- Parameters:
outline- the dictionary representing the document outline.- Returns:
- true if the Count entry is present.
-
isCountEntryPositive
return true if Count entry > 0- Parameters:
ctx- the preflight context.outline- the dictionary representing the document outline.- Returns:
- true if the Count entry > 0.
-
checkIndirectObjects
-
checkIndirectObject
-
toCOSObject
Returns a COSBase as a COSObject or null if null or COSNull. To avoid trouble, this method is to be called only after having calledcheckIndirectObjects(PreflightContext, COSDictionary).- Parameters:
base- should be null, COSNull or a COSObject.- Returns:
- null if the parameter is COSNull or null; or else a COSObject.
- Throws:
IllegalArgumentException- if the parameter is not null, COSNull or a COSObject.
-