Examples of validate()


Examples of org.apache.padaf.preflight.graphics.color.ColorSpaceHelper.validate()

        csHelper = ColorSpaceHelperFactory.getColorSpaceHelper(csInlinedBase,
            documentHandler, ColorSpaceRestriction.ONLY_DEVICE);
      }
      List<ValidationError> errors = new ArrayList<ValidationError>();
      try {
        if (!csHelper.validate(errors)) {
          ValidationError ve = errors.get(0);
          throwContentStreamException(ve.getDetails(), ve.getErrorCode());
        }
      } catch (ValidationException e) {
        throw new IOException(e.getMessage());
View Full Code Here

Examples of org.apache.padaf.preflight.helpers.AcroFormValidationHelper.validate()

public class TestAbstractHelper {

  @Test(expected = ValidationException.class)
  public void testAbstractHelperCheckMethod() throws ValidationException {
    AcroFormValidationHelper afvh = new AcroFormValidationHelper(PdfAValidatorFactory.getStandardPDFA1BConfiguration());
    afvh.validate(new DocumentHandlerStub(null));
  }

  @Test(expected = ValidationException.class)
  public void testAbstractHelperCheckMethod2() throws ValidationException {
    AcroFormValidationHelper afvh = new AcroFormValidationHelper(PdfAValidatorFactory.getStandardPDFA1BConfiguration());
View Full Code Here

Examples of org.apache.pdfbox.preflight.PreflightDocument.validate()

        PreflightDocument document = parser.getPreflightDocument();

        // Validate the document.
        ValidationResult result = null;
        try {
            document.validate();
            result = document.getResult();
        } catch (SyntaxValidationException exception) {
            result = exception.getResult();
        } finally {
            document.close();
View Full Code Here

Examples of org.apache.pdfbox.preflight.annotation.AnnotationValidator.validate()

            PreflightConfiguration config = context.getConfig();
            AnnotationValidatorFactory factory = config.getAnnotFact();
            AnnotationValidator annotValidator = factory.getAnnotationValidator(context, annotDict);
            if (annotValidator != null)
            {
                annotValidator.validate();
            }
        }
    }

}
View Full Code Here

Examples of org.apache.pdfbox.preflight.graphic.ColorSpaceHelper.validate()

        {
            PDColorSpace pColorSpace = shadingRes.getColorSpace();
            PreflightConfiguration config = context.getConfig();
            ColorSpaceHelperFactory csFact = config.getColorSpaceHelperFact();
            ColorSpaceHelper csh = csFact.getColorSpaceHelper(context, pColorSpace, ColorSpaceRestriction.NO_PATTERN);
            csh.validate();
        }
        catch (IOException e)
        {
            context.addValidationError(new ValidationError(ERROR_GRAPHIC_INVALID_UNKNOWN_COLOR_SPACE, e.getMessage()));
        }
View Full Code Here

Examples of org.apache.pdfbox.preflight.parser.XmlResultParser.validate()

                    Element root = document.createElement("preflights");
                    document.appendChild(root);
                    root.setAttribute("count", String.format("%d", ftp.size()));
                    for (File file : ftp)
                    {
                        Element result = xrp.validate(document,new FileDataSource(file));
                        root.appendChild(result);
                    }
                    transformer.transform(new DOMSource(document), new StreamResult(new File(args[posFile]+".preflight.xml")));
                } else {
                    // isBatch
View Full Code Here

Examples of org.apache.pdfbox.preflight.process.ValidationProcess.validate()

    {
        PreflightPath validationPath = context.getValidationPath();
        boolean needPop = validationPath.pushObject(element);
        PreflightConfiguration config = context.getConfig();
        ValidationProcess process = config.getInstanceOfProcess(processName);
        process.validate(context);
        if (needPop) {
            validationPath.pop();
        }
    }
View Full Code Here

Examples of org.apache.pdfbox.preflight.xobject.XObjectValidator.validate()

        {
            context.addValidationError(new ValidationError(PreflightConstants.ERROR_GRAPHIC_MISSING_OBJECT, "Graphic validation process needs at least one PDXObject"));
        }

        if (validator != null) {
            validator.validate();
        }
    }
}
View Full Code Here

Examples of org.apache.pig.impl.logicalLayer.validators.LogicalPlanValidationExecutor.validate()

        CompilationMessageCollector collector = new CompilationMessageCollector();
        FrontendException caught = null;
        try {
            LogicalPlanValidationExecutor validator = new LogicalPlanValidationExecutor(
                    plan, pigContext);
            validator.validate(plan, collector);

            FunctionalLogicalOptimizer optimizer = new FunctionalLogicalOptimizer(
                    plan);
            optimizer.optimize();
        } catch (FrontendException fe) {
View Full Code Here

Examples of org.apache.pig.impl.logicalLayer.validators.SchemaAliasValidator.validate()

    public void testDuplicateSchema1() {
        try {
            LogicalPlan lp = buildPlan(" a = load '1.txt' as (a0:int, a0:int);");
            SchemaAliasValidator schemaAliasValidator = new SchemaAliasValidator() ;
            CompilationMessageCollector collector = new CompilationMessageCollector() ;
            schemaAliasValidator.validate(lp, collector);
        } catch (PlanValidationException e) {
            assertTrue(e.getCause().getMessage().contains("Duplicate schema"));
            return;
        }
        fail();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.