public class GraphicObjectPageValidationProcess extends AbstractProcess
{
public void validate(PreflightContext context) throws ValidationException
{
PreflightPath vPath = context.getValidationPath();
XObjectValidator validator = null;
if (!vPath.isEmpty() && vPath.isExpectedType(PDImageXObject.class))
{
validator = new XObjImageValidator(context, (PDImageXObject) vPath.peek());
}
else if (!vPath.isEmpty() && vPath.isExpectedType(PDFormXObject.class))
{
validator = new XObjFormValidator(context, (PDFormXObject) vPath.peek());
}
else if (!vPath.isEmpty() && vPath.isExpectedType(PDPostScriptXObject.class))
{
validator = new XObjPostscriptValidator(context, (PDPostScriptXObject) vPath.peek());
}
else if (!vPath.isEmpty() && vPath.isExpectedType(COSStream.class))
{
context.addValidationError(new ValidationError(PreflightConstants.ERROR_GRAPHIC_XOBJECT_INVALID_TYPE, "Invalid XObject subtype"));
}
else
{