Class ValidatorFactory
java.lang.Object
org.verapdf.pdfa.validation.validators.ValidatorFactory
Static utility class that fills in for a factory for
PDFAValidator
s.- Author:
- Carl Wilson
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
configToXml
(ValidatorConfig source) Serialises aValidatorConfig
to XMLstatic void
configToXml
(ValidatorConfig source, OutputStream dest) Serialises aValidatorConfig
instance to its XML representation that's output to the passedOutputStream
.static ValidatorConfig
createConfig
(InputStream source) De-serialises aValidatorConfig
instance from it's XML representationstatic ValidatorConfig
createConfig
(PDFAFlavour flavour, boolean recordPasses, int maxFails, boolean debug) Create aValidatorConfig
instance from the passed values.static ValidatorConfig
createConfig
(PDFAFlavour flavour, boolean recordPasses, int maxFails, boolean debug, boolean isLogsEnabled, Level loggingLevel, String password, boolean showProgress) static ValidatorConfig
createConfig
(PDFAFlavour flavour, PDFAFlavour defaultFlavour, boolean recordPasses, int maxFails, boolean debug, boolean isLogsEnabled, Level loggingLevel, int maxNumberOfDisplayedFailedChecks, boolean showErrorMessages, String password, boolean showProgress, boolean nonPDFExtension) static PDFAValidator
createValidator
(PDFAFlavour flavour, boolean logPassedChecks) Creates a newPDFAValidator
instance that uses one of theValidationProfile
s packaged as a core library resource.static PDFAValidator
createValidator
(PDFAFlavour flavour, boolean logPassedChecks, int maxFailures) Creates a newPDFAValidator
instance that uses one of theValidationProfile
s packaged as a core library resource, seeValidators#createValidator(PDFAFlavour, boolean)
.static PDFAValidator
createValidator
(PDFAFlavour flavour, boolean logPassedChecks, int maxFailures, int maxNumberOfDisplayedFailedChecks, boolean showErrorMessages, boolean showProgress) static PDFAValidator
createValidator
(PDFAFlavour flavour, int maxFailures, boolean showProgress) Creates a newPDFAValidator
initialised with the passed profile, requested fast failing behaviour and configured NOT to log passed checks.static PDFAValidator
createValidator
(PDFAFlavour flavour, int maxNumberOfDisplayedFailedChecks, boolean logPassedChecks, boolean showErrorMessages, boolean showProgress) static PDFAValidator
createValidator
(ValidationProfile profile) Creates a newPDFAValidator
initialised with the passed profile and configured NOT to log passed checks.static PDFAValidator
createValidator
(ValidationProfile profile, boolean logPassedChecks) Creates a newPDFAValidator
initialised with the passed profile and chosen passed test logging.static PDFAValidator
createValidator
(ValidationProfile profile, boolean logPassedChecks, int maxFailures) Creates a newPDFAValidator
initialised with the passed profile, chosen passed test logging and requested fast failing behaviour.static PDFAValidator
createValidator
(ValidationProfile profile, boolean logPassedChecks, int maxFailures, int maxNumberOfDisplayedFailedChecks, boolean showErrorMessages, boolean showProgress) static PDFAValidator
createValidator
(ValidationProfile profile, int maxFailures, boolean showProgress) Creates a newPDFAValidator
initialised with the passed profile, requested fast failing behaviour and configured NOT to log passed checks.static PDFAValidator
createValidator
(ValidationProfile profile, int maxNumberOfDisplayedFailedChecks, boolean logPassedChecks, boolean showErrorMessages, boolean showProgress) static ValidatorConfig
-
Method Details
-
createValidator
Creates a newPDFAValidator
instance that uses one of theValidationProfile
s packaged as a core library resource. While these profiles are not guaranteed to be up to date, they are available when offline. AProfileDirectory
populated with the pre-loaded profiles can be obtained by callingProfiles.getVeraProfileDirectory()
.- Parameters:
flavour
- thePDFAFlavour
that's associated with theValidationProfile
to used to initialise thePDFAValidator
.logPassedChecks
-boolean
used to configure logging of passed tests by thePDFAValidator
. Passtrue
to log passed tests,false
to only log tests that don't pass.- Returns:
- a
PDFAValidator
instance initialised from the passed parameters
-
createValidator
public static PDFAValidator createValidator(PDFAFlavour flavour, int maxNumberOfDisplayedFailedChecks, boolean logPassedChecks, boolean showErrorMessages, boolean showProgress) -
createValidator
public static PDFAValidator createValidator(PDFAFlavour flavour, boolean logPassedChecks, int maxFailures) Creates a newPDFAValidator
instance that uses one of theValidationProfile
s packaged as a core library resource, seeValidators#createValidator(PDFAFlavour, boolean)
.- Parameters:
flavour
- thePDFAFlavour
that's associated with theValidationProfile
to used to initialise thePDFAValidator
.logPassedChecks
-boolean
used to configure logging of passed tests by thePDFAValidator
. Passtrue
to log passed tests,false
to only log tests that don't pass.maxFailures
- anint
value that configures thePDFAValidator
to abort validation aftermaxFailures
failed tests. IfmaxFailures
is less than 1 then thePDFAValidator
will complete the full validation process.- Returns:
- a
PDFAValidator
instance initialised from the passed parameters
-
createValidator
public static PDFAValidator createValidator(PDFAFlavour flavour, boolean logPassedChecks, int maxFailures, int maxNumberOfDisplayedFailedChecks, boolean showErrorMessages, boolean showProgress) -
createValidator
Creates a newPDFAValidator
initialised with the passed profile and configured NOT to log passed checks.- Parameters:
profile
- theValidationProfile
to be enforced by the returnedPDFAValidator
.- Returns:
- a
PDFAValidator
instance initialised from the passed parameters
-
createValidator
Creates a newPDFAValidator
initialised with the passed profile and chosen passed test logging.- Parameters:
profile
- theValidationProfile
to be enforced by the returnedPDFAValidator
.logPassedChecks
-boolean
used to configure logging of passed tests by thePDFAValidator
. Passtrue
to log passed tests,false
to only log tests that don't pass.- Returns:
- a
PDFAValidator
instance initialised from the passed parameters
-
createValidator
public static PDFAValidator createValidator(ValidationProfile profile, int maxNumberOfDisplayedFailedChecks, boolean logPassedChecks, boolean showErrorMessages, boolean showProgress) -
createValidator
public static PDFAValidator createValidator(ValidationProfile profile, int maxFailures, boolean showProgress) Creates a newPDFAValidator
initialised with the passed profile, requested fast failing behaviour and configured NOT to log passed checks.- Parameters:
profile
- theValidationProfile
to be enforced by the returnedPDFAValidator
.maxFailures
- anint
value that configures thePDFAValidator
to abort validation aftermaxFailures
failed tests. IfmaxFailures
is less than 1 then thePDFAValidator
will complete the full validation process.- Returns:
- a
PDFAValidator
instance initialised from the passed parameters
-
createValidator
public static PDFAValidator createValidator(PDFAFlavour flavour, int maxFailures, boolean showProgress) Creates a newPDFAValidator
initialised with the passed profile, requested fast failing behaviour and configured NOT to log passed checks.- Parameters:
flavour
- thePDFAFlavour
that's associated with theValidationProfile
to used to initialise thePDFAValidator
.maxFailures
- anint
value that configures thePDFAValidator
to abort validation aftermaxFailures
failed tests. IfmaxFailures
is less than 1 then thePDFAValidator
will complete the full validation process.- Returns:
- a
PDFAValidator
instance initialised from the passed parameters
-
createValidator
public static PDFAValidator createValidator(ValidationProfile profile, boolean logPassedChecks, int maxFailures) Creates a newPDFAValidator
initialised with the passed profile, chosen passed test logging and requested fast failing behaviour.- Parameters:
profile
- theValidationProfile
to be enforced by the returnedPDFAValidator
.logPassedChecks
-boolean
used to configure logging of passed tests by thePDFAValidator
. Passtrue
to log passed tests,false
to only log tests that don't pass.maxFailures
- anint
value that configures thePDFAValidator
to abort validation aftermaxFailures
failed tests. IfmaxFailures
is less than 1 then thePDFAValidator
will complete the full validation process.- Returns:
- a
PDFAValidator
instance initialised from the passed parameters
-
createValidator
public static PDFAValidator createValidator(ValidationProfile profile, boolean logPassedChecks, int maxFailures, int maxNumberOfDisplayedFailedChecks, boolean showErrorMessages, boolean showProgress) -
defaultConfig
- Returns:
- the default
ValidatorConfig
instance
-
createConfig
public static ValidatorConfig createConfig(PDFAFlavour flavour, boolean recordPasses, int maxFails, boolean debug) Create aValidatorConfig
instance from the passed values.- Parameters:
flavour
- thePDFAFlavour
used for validationrecordPasses
- aboolean
parameter, settrue
to record passed checks,false
to only record failed checks.maxFails
- anint
value for the number of failed checks encountered before ending validation.- Returns:
- a new
ValidatorConfig
instance created from the passed values.
-
createConfig
public static ValidatorConfig createConfig(PDFAFlavour flavour, boolean recordPasses, int maxFails, boolean debug, boolean isLogsEnabled, Level loggingLevel, String password, boolean showProgress) -
createConfig
public static ValidatorConfig createConfig(PDFAFlavour flavour, PDFAFlavour defaultFlavour, boolean recordPasses, int maxFails, boolean debug, boolean isLogsEnabled, Level loggingLevel, int maxNumberOfDisplayedFailedChecks, boolean showErrorMessages, String password, boolean showProgress, boolean nonPDFExtension) -
createConfig
De-serialises aValidatorConfig
instance from it's XML representation- Parameters:
source
- anInputStream
that is an XML representation of aValidatorConfig
- Returns:
- a
ValidatorConfig
instance created from the passed XML stream - Throws:
JAXBException
- when there's an error de-serialising
-
configToXml
Serialises aValidatorConfig
to XML- Parameters:
source
- aValidatorConfig
instance to serialise- Returns:
- a
String
containing the XML representation of the passedValidatorConfig
instance. - Throws:
JAXBException
- when there's an error serialising
-
configToXml
Serialises aValidatorConfig
instance to its XML representation that's output to the passedOutputStream
.- Parameters:
source
- theValidatorConfig
instance to serialisedest
- anOutputStream
to which the serialised instance will be written- Throws:
JAXBException
- when there's an error serialising
-