Top Description Fields Constructors Methods
org.apache.pdfbox.preflight.xobject

public abstract Class AbstractXObjValidator

extends Object
implements XObjectValidator
Class Inheritance
All Implemented Interfaces
org.apache.pdfbox.preflight.xobject.XObjectValidator
Known Direct Subclasses
org.apache.pdfbox.preflight.xobject.XObjFormValidator, org.apache.pdfbox.preflight.xobject.XObjImageValidator, org.apache.pdfbox.preflight.xobject.XObjPostscriptValidator
Static Imports
org.apache.pdfbox.preflight.PreflightConstants.ERROR_GRAPHIC_TRANSPARENCY_SMASK, .PreflightConstants.ERROR_GRAPHIC_UNEXPECTED_KEY, .PreflightConstants.ERROR_GRAPHIC_UNEXPECTED_VALUE_FOR_KEY

This class processes commons validations of XObjects.

Field Summary

Modifier and TypeField and Description
protected PreflightContext
context

The validation context which contains useful information to process validation.

protected COSStream
xobject

The XObject to validate as a COSStream.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected abstract void
checkMandatoryFields()

This method checks if required fields are present.

protected void
checkOPI()

According the ISO 190005:1-2005 specification, a XObject can't have an OPI entry in its dictionary.

protected void
checkPostscriptXObject()

According the ISO 190005:1-2005 specification, PostScript XObjects are forbidden.

protected void
checkReferenceXObject()

According the ISO 190005:1-2005 specification, a XObject can't have an Ref entry in its dictionary.

protected void
checkSMask()

This method checks the SMask entry in the XObject dictionary.

public void
validate()

Implements org.apache.pdfbox.preflight.xobject.XObjectValidator.validate.

Process the validation of the XObject.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

contextback to summary
protected PreflightContext context

The validation context which contains useful information to process validation.

xobjectback to summary
protected COSStream xobject

The XObject to validate as a COSStream.

Constructor Detail

AbstractXObjValidatorback to summary
public AbstractXObjValidator(PreflightContext context, COSStream xobj)

Method Detail

checkMandatoryFieldsback to summary
protected abstract void checkMandatoryFields()

This method checks if required fields are present.

checkOPIback to summary
protected void checkOPI()

According the ISO 190005:1-2005 specification, a XObject can't have an OPI entry in its dictionary. If the XObject has a OPI entry, the error list is updated with the error code ERROR_GRAPHIC_UNEXPECTED_KEY (2.3).

checkPostscriptXObjectback to summary
protected void checkPostscriptXObject()

According the ISO 190005:1-2005 specification, PostScript XObjects are forbidden. If the XObject is a PostScript XObject, the error list is updated with the error code ERROR_GRAPHIC_UNEXPECTED_VALUE_FOR_KEY (2.3.2). To know whether the object is a Postscript XObject, "Subtype" and "Subtype2" entries are checked.

checkReferenceXObjectback to summary
protected void checkReferenceXObject()

According the ISO 190005:1-2005 specification, a XObject can't have an Ref entry in its dictionary. If the XObject has a Ref entry, the error list is updated with the error code ERROR_GRAPHIC_UNEXPECTED_KEY (2.3).

checkSMaskback to summary
protected void checkSMask()

This method checks the SMask entry in the XObject dictionary. According to the PDF Reference, a SMask in a XObject is a Stream. So if it is not null, it should be an error but a SMask with the name None is authorized in the PDF/A Specification 6.4. If the validation fails (SMask not null and different from None), the error list is updated with the error code ERROR_GRAPHIC_TRANSPARENCY_SMASK (2.2.2).

validateback to summary
public void validate() throws ValidationException

Implements org.apache.pdfbox.preflight.xobject.XObjectValidator.validate.

Doc from org.apache.pdfbox.preflight.xobject.XObjectValidator.validate.

Process the validation of the XObject.

Annotations
@Override