Package org.verapdf.pdfa.results
Class ValidationResults
java.lang.Object
org.verapdf.pdfa.results.ValidationResults
- Author:
- Carl Wilson
-
Method Summary
Modifier and TypeMethodDescriptionstatic TestAssertionassertionFromValues(int ordinal, RuleId ruleId, TestAssertion.Status status, String message, Location location, String context, String errorMessage, List<ErrorArgument> errorArguments) Creates an immutable TestAssertion instance from the passed parameter values.static TestAssertionReturns an immutable default instance of a TestAssertion.static LocationReturns an immutable default instance of a Location.static ValidationResultReturns an immutable default instance of a ValidationResult.static LocationlocationFromValues(String level, String context) TODO: Better explanation of level and context.static ValidationResultresultFromValues(ValidationProfile validationProfile, List<TestAssertion> assertions, boolean isCompliant, JobEndStatus endStatus) static ValidationResultresultFromValues(ValidationProfile validationProfile, List<TestAssertion> assertions, HashMap<RuleId, Integer> failedChecks, boolean isCompliant, int totalAssertions, JobEndStatus endStatus) static ValidationResultresultFromValues(ValidationProfile validationProfile, List<TestAssertion> assertions, JobEndStatus endStatus) static ValidationResultresultFromXmlString(String xmlSource) static ValidationResultstripPassedTests(ValidationResult toStrip) Strips anyTestAssertions whereassertion.getStatus() == TestAssertion.Status.PASSEDfromtoStripand returns a newValidationResultwithout the passed assertions.
-
Method Details
-
resultFromValues
public static ValidationResult resultFromValues(ValidationProfile validationProfile, List<TestAssertion> assertions, boolean isCompliant, JobEndStatus endStatus) - Parameters:
validationProfile- aValidationProfileinstance indicating the validation type performedassertions- the Set of TestAssertions reported by during validationisCompliant- a boolean that indicating whether the validated PDF/A data was compliant with the indicated flavour- Returns:
- a new ValidationResult instance populated from the values
-
resultFromValues
public static ValidationResult resultFromValues(ValidationProfile validationProfile, List<TestAssertion> assertions, HashMap<RuleId, Integer> failedChecks, boolean isCompliant, int totalAssertions, JobEndStatus endStatus) - Parameters:
validationProfile- aValidationProfileinstance indicating the validation type performedassertions- the Set of TestAssertions reported by during validationisCompliant- a boolean that indicating whether the validated PDF/A data was compliant with the indicated flavourtotalAssertions-- Returns:
- a new ValidationResult instance populated from the values
-
resultFromValues
public static ValidationResult resultFromValues(ValidationProfile validationProfile, List<TestAssertion> assertions, JobEndStatus endStatus) - Parameters:
validationProfile- aValidationProfileinstance indicating the validation type performedassertions- the Set of TestAssertions reported by during validation- Returns:
- a new ValidationResult instance populated from the values
-
resultFromXmlString
- Parameters:
xmlSource- XML representation of aValidationResultto deserialise- Returns:
- a new ValidationResult instance deserialised from the passed String
- Throws:
JAXBException- when the passed String is not a valid XML representation
-
defaultResult
Returns an immutable default instance of a ValidationResult. This is a static single instance, i.e.ValidationResults.defaultResult() == ValidationResults.defaultResult()is always true.- Returns:
- the default ValidationResult instance
-
assertionFromValues
public static TestAssertion assertionFromValues(int ordinal, RuleId ruleId, TestAssertion.Status status, String message, Location location, String context, String errorMessage, List<ErrorArgument> errorArguments) Creates an immutable TestAssertion instance from the passed parameter values.- Parameters:
ordinal- the integer ordinal for the instanceruleId- theRuleIdvalue forRulethe assertion refers to.status- theTestAssertion.Statusof the assertion.message- any String message to be associated with the assertion.location- aLocationinstance indicating the location within the PDF document where the test was performed.- Returns:
- an immutable TestAssertion instance initialised using the passed values
-
defaultAssertion
Returns an immutable default instance of a TestAssertion. This is a static single instance, i.e.ValidationResults.defaultAssertion() == ValidationResults.defaultAssertion()is always true.- Returns:
- the default TestAssertion instance
-
locationFromValues
TODO: Better explanation of level and context. Creates an immutableLocationinstance.- Parameters:
level- the Locations level, represented as a Stringcontext- the Locations context, represented as a String- Returns:
- and immutable Location instance initialised with the passed values.
-
defaultLocation
Returns an immutable default instance of a Location. This is a static single instance, i.e.ValidationResults.defaultLocation() == ValidationResults.defaultLocation()is always true.- Returns:
- the default Location instance
-
stripPassedTests
Strips anyTestAssertions whereassertion.getStatus() == TestAssertion.Status.PASSEDfromtoStripand returns a newValidationResultwithout the passed assertions.- Parameters:
toStrip- aValidationResultto clone without passedTestAssertions- Returns:
- a ValidationResult instance identical to
toStrip, but without passedTestAssertions.
-