Class ValidationResults

java.lang.Object
org.verapdf.pdfa.results.ValidationResults

public class ValidationResults extends Object
Author:
Carl Wilson
  • Method Details

    • resultFromValues

      public static ValidationResult resultFromValues(ValidationProfile validationProfile, List<TestAssertion> assertions, boolean isCompliant, JobEndStatus endStatus)
      Parameters:
      validationProfile - a ValidationProfile instance indicating the validation type performed
      assertions - the Set of TestAssertions reported by during validation
      isCompliant - 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 - a ValidationProfile instance indicating the validation type performed
      assertions - the Set of TestAssertions reported by during validation
      isCompliant - a boolean that indicating whether the validated PDF/A data was compliant with the indicated flavour
      totalAssertions -
      Returns:
      a new ValidationResult instance populated from the values
    • resultFromValues

      public static ValidationResult resultFromValues(ValidationProfile validationProfile, List<TestAssertion> assertions, JobEndStatus endStatus)
      Parameters:
      validationProfile - a ValidationProfile instance indicating the validation type performed
      assertions - the Set of TestAssertions reported by during validation
      Returns:
      a new ValidationResult instance populated from the values
    • resultFromXmlString

      public static ValidationResult resultFromXmlString(String xmlSource) throws JAXBException
      Parameters:
      xmlSource - XML representation of a ValidationResult to deserialise
      Returns:
      a new ValidationResult instance deserialised from the passed String
      Throws:
      JAXBException - when the passed String is not a valid XML representation
    • defaultResult

      public static ValidationResult 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 instance
      ruleId - the RuleId value for Rule the assertion refers to.
      status - the TestAssertion.Status of the assertion.
      message - any String message to be associated with the assertion.
      location - a Location instance indicating the location within the PDF document where the test was performed.
      Returns:
      an immutable TestAssertion instance initialised using the passed values
    • defaultAssertion

      public static TestAssertion 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

      public static Location locationFromValues(String level, String context)
      TODO: Better explanation of level and context. Creates an immutable Location instance.
      Parameters:
      level - the Locations level, represented as a String
      context - the Locations context, represented as a String
      Returns:
      and immutable Location instance initialised with the passed values.
    • defaultLocation

      public static Location 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

      public static ValidationResult stripPassedTests(ValidationResult toStrip)
      Strips any TestAssertions where assertion.getStatus() == TestAssertion.Status.PASSED from toStrip and returns a new ValidationResult without the passed assertions.
      Parameters:
      toStrip - a ValidationResult to clone without passed TestAssertions
      Returns:
      a ValidationResult instance identical to toStrip, but without passed TestAssertions.