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 boolean
abortProcessing
static int
DEFAULT_MAX_NUMBER_OF_DISPLAYED_FAILED_CHECKS
protected boolean
isCompliant
protected boolean
logPassedTests
protected int
maxNumberOfDisplayedFailedChecks
protected List<TestAssertion>
results
protected String
rootType
protected int
testCounter
-
Constructor Summary
Constructors Modifier Constructor Description protected
BaseValidator(ValidationProfile profile)
protected
BaseValidator(ValidationProfile profile, boolean logPassedTests)
protected
BaseValidator(ValidationProfile profile, int maxNumberOfDisplayedFailedChecks, boolean logPassedTests, boolean showErrorMessages)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
ComponentDetails
getDetails()
ValidationProfile
getProfile()
Returns the completeValidationProfile
enforced by this PDFAValidator.protected void
initialise()
protected void
processAssertionResult(boolean assertionResult, String locationContext, Rule rule, Object obj)
protected ValidationResult
validate(Object root)
ValidationResult
validate(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:PDFAValidator
Returns the completeValidationProfile
enforced by this PDFAValidator.- Specified by:
getProfile
in interfacePDFAValidator
- Returns:
- this PDFAValidator instance's ValiationProfile
-
validate
public ValidationResult validate(PDFAParser toValidate) throws ValidationException
Description copied from interface:PDFAValidator
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.- Specified by:
validate
in interfacePDFAValidator
- Parameters:
toValidate
- aInputStream
to be validated- Returns:
- a
ValidationResult
containing the result of valdiation and details of failed checks and possibly passed checks, dependent upon configuration. - Throws:
ValidationException
-
getDetails
public ComponentDetails getDetails()
- Specified by:
getDetails
in 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
-