Class BaseValidator
- java.lang.Object
-
- org.verapdf.pdfa.validation.validators.BaseValidator
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Component,PDFAValidator
public class BaseValidator extends Object implements PDFAValidator
- Author:
- Carl Wilson
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanabortProcessingstatic intDEFAULT_MAX_NUMBER_OF_DISPLAYED_FAILED_CHECKSprotected booleanisCompliantprotected booleanlogPassedTestsprotected intmaxNumberOfDisplayedFailedChecksprotected List<TestAssertion>resultsprotected StringrootTypeprotected inttestCounter
-
Constructor Summary
Constructors Modifier Constructor Description protectedBaseValidator(ValidationProfile profile)protectedBaseValidator(ValidationProfile profile, boolean logPassedTests)protectedBaseValidator(ValidationProfile profile, int maxNumberOfDisplayedFailedChecks, boolean logPassedTests, boolean showErrorMessages)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()ComponentDetailsgetDetails()ValidationProfilegetProfile()Returns the completeValidationProfileenforced by this PDFAValidator.protected voidinitialise()protected voidprocessAssertionResult(boolean assertionResult, String locationContext, Rule rule, Object obj)protected ValidationResultvalidate(Object root)ValidationResultvalidate(PDFAParser toValidate)This method validates an InputStream, presumably believed to be a PDF/A document of a specific flavour that matches the ValidationProfile supported by the PDFAValidator instance.
-
-
-
Field Detail
-
DEFAULT_MAX_NUMBER_OF_DISPLAYED_FAILED_CHECKS
public static final int DEFAULT_MAX_NUMBER_OF_DISPLAYED_FAILED_CHECKS
- See Also:
- Constant Field Values
-
results
protected final List<TestAssertion> results
-
testCounter
protected int testCounter
-
abortProcessing
protected boolean abortProcessing
-
logPassedTests
protected final boolean logPassedTests
-
maxNumberOfDisplayedFailedChecks
protected final int maxNumberOfDisplayedFailedChecks
-
isCompliant
protected boolean isCompliant
-
rootType
protected String rootType
-
-
Constructor Detail
-
BaseValidator
protected BaseValidator(ValidationProfile profile)
-
BaseValidator
protected BaseValidator(ValidationProfile profile, boolean logPassedTests)
-
BaseValidator
protected BaseValidator(ValidationProfile profile, int maxNumberOfDisplayedFailedChecks, boolean logPassedTests, boolean showErrorMessages)
-
-
Method Detail
-
getProfile
public ValidationProfile getProfile()
Description copied from interface:PDFAValidatorReturns the completeValidationProfileenforced by this PDFAValidator.- Specified by:
getProfilein interfacePDFAValidator- Returns:
- this PDFAValidator instance's ValiationProfile
-
validate
public ValidationResult validate(PDFAParser toValidate) throws ValidationException
Description copied from interface:PDFAValidatorThis method validates an InputStream, presumably believed to be a PDF/A document of a specific flavour that matches the ValidationProfile supported by the PDFAValidator instance.- Specified by:
validatein interfacePDFAValidator- Parameters:
toValidate- aInputStreamto be validated- Returns:
- a
ValidationResultcontaining the result of valdiation and details of failed checks and possibly passed checks, dependent upon configuration. - Throws:
ValidationException
-
getDetails
public ComponentDetails getDetails()
- Specified by:
getDetailsin interfaceComponent
-
validate
protected ValidationResult validate(Object root) throws ValidationException
- Throws:
ValidationException
-
initialise
protected void initialise()
-
processAssertionResult
protected void processAssertionResult(boolean assertionResult, String locationContext, Rule rule, Object obj)
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
-