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 JobEndStatusjobEndStatusprotected booleanlogPassedChecksprotected intmaxNumberOfDisplayedFailedChecksprotected List<TestAssertion>resultsprotected StringrootTypeprotected inttestCounterprotected ValidationProgressvalidationProgress
-
Constructor Summary
Constructors Modifier Constructor Description protectedBaseValidator(ValidationProfile profile)protectedBaseValidator(ValidationProfile profile, boolean logPassedChecks)protectedBaseValidator(ValidationProfile profile, int maxNumberOfDisplayedFailedChecks, boolean logPassedChecks, boolean showErrorMessages, boolean showProgress)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancelValidation(JobEndStatus endStatus)voidclose()ComponentDetailsgetDetails()ValidationProfilegetProfile()Returns the completeValidationProfileenforced by this PDFAValidator.StringgetValidationProgressString()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 volatile boolean abortProcessing
-
logPassedChecks
protected final boolean logPassedChecks
-
maxNumberOfDisplayedFailedChecks
protected final int maxNumberOfDisplayedFailedChecks
-
isCompliant
protected boolean isCompliant
-
validationProgress
protected ValidationProgress validationProgress
-
jobEndStatus
protected volatile JobEndStatus jobEndStatus
-
rootType
protected String rootType
-
-
Constructor Detail
-
BaseValidator
protected BaseValidator(ValidationProfile profile)
-
BaseValidator
protected BaseValidator(ValidationProfile profile, boolean logPassedChecks)
-
BaseValidator
protected BaseValidator(ValidationProfile profile, int maxNumberOfDisplayedFailedChecks, boolean logPassedChecks, boolean showErrorMessages, boolean showProgress)
-
-
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
-
getValidationProgressString
public String getValidationProgressString()
- Specified by:
getValidationProgressStringin interfacePDFAValidator
-
cancelValidation
public void cancelValidation(JobEndStatus endStatus)
- Specified by:
cancelValidationin interfacePDFAValidator
-
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
-
-