public class ValidationResults extends Object
| Modifier and Type | Method and Description |
|---|---|
static TestAssertion |
assertionFromValues(int ordinal,
RuleId ruleId,
TestAssertion.Status status,
String message,
Location location)
Creates an immutable TestAssertion instance from the passed parameter
values.
|
static TestAssertion |
defaultAssertion()
Returns an immutable default instance of a TestAssertion.
|
static Location |
defaultLocation()
Returns an immutable default instance of a Location.
|
static ValidationResult |
defaultResult()
Returns an immutable default instance of a ValidationResult.
|
static ValidationResult |
fromXml(InputStream toConvert)
Converts an XML representation of a
ValidationResult into a
ValidationResult instance. |
static ValidationResult |
fromXml(Reader toConvert)
Converts an XML representation of a
ValidationResult into a
ValidationResult instance. |
static ValidationResult |
fromXml(String toConvert)
Converts an XML representation of a
ValidationResult into a
ValidationResult instance. |
static String |
getValidationResultSchema()
Returns the JAXB generated XML schema for the ValidationProfileImpl type.
|
static Location |
locationFromValues(String level,
String context)
TODO: Better explanation of level and context.
|
static ValidationResult |
resultFromValues(PDFAFlavour flavour,
Set<TestAssertion> assertions) |
static ValidationResult |
resultFromValues(PDFAFlavour flavour,
Set<TestAssertion> assertions,
boolean isCompliant) |
static ValidationResult |
resultFromValues(PDFAFlavour flavour,
Set<TestAssertion> assertions,
boolean isCompliant,
int totalAssertions) |
static String |
resultToXml(ValidationResult toConvert,
Boolean prettyXml)
Converts a
ValidationResult instance into an XML String. |
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. |
static void |
toXml(ValidationResult toConvert,
OutputStream stream,
Boolean prettyXml)
Converts a
ValidationResult instance into XML which is written to
the passed stream. |
static void |
toXml(ValidationResult toConvert,
Writer writer,
Boolean prettyXml)
Converts a
ValidationResult instance into XML which is written to
the passed writer. |
public static ValidationResult resultFromValues(PDFAFlavour flavour, Set<TestAssertion> assertions, boolean isCompliant)
flavour - a PDFAFlavour instance 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 flavourpublic static ValidationResult resultFromValues(PDFAFlavour flavour, Set<TestAssertion> assertions, boolean isCompliant, int totalAssertions)
flavour - a PDFAFlavour instance 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 - public static ValidationResult resultFromValues(PDFAFlavour flavour, Set<TestAssertion> assertions)
flavour - a PDFAFlavour instance indicating the validation type
performedassertions - the Set of TestAssertions reported by during validationpublic static ValidationResult defaultResult()
ValidationResults.defaultResult() == ValidationResults.defaultResult()
is always true.public static TestAssertion assertionFromValues(int ordinal, RuleId ruleId, TestAssertion.Status status, String message, Location location)
ordinal - the integer ordinal for the instanceruleId - 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.public static TestAssertion defaultAssertion()
ValidationResults.defaultAssertion() == ValidationResults.defaultAssertion()
is always true.public static Location locationFromValues(String level, String context)
Location instance.level - the Locations level, represented as a Stringcontext - the Locations context, represented as a Stringpublic static Location defaultLocation()
ValidationResults.defaultLocation() == ValidationResults.defaultLocation()
is always true.public static String resultToXml(ValidationResult toConvert, Boolean prettyXml) throws JAXBException, IOException
ValidationResult instance into an XML String. The
returned String can be de-serialised from XML to a
ValidationResult instance by passing it to the
fromXml(String) method.toConvert - a ValidationResult instance to covert to XMLprettyXml - controls formatting of the returned XML, Boolean.TRUE
requests pretty formatting, e.g. new lines and indentation,
Boolean.FALSE indicates no formatting is required.toConvert.JAXBException - this occurs if there's a problem converting the passed type
to XMLIOException - if a problem occurs writing the converted result to a String.public static ValidationResult fromXml(String toConvert) throws JAXBException
ValidationResult into a
ValidationResult instance.toConvert - a String holding an XML serialisation of a ValidationResult.JAXBException - when there's an error converting the XMLpublic static void toXml(ValidationResult toConvert, OutputStream stream, Boolean prettyXml) throws JAXBException
ValidationResult instance into XML which is written to
the passed stream.toConvert - a ValidationResult instance to covert to XMLstream - an OutputStream, the destination where the XML representation
of the ValidationResult will be written.prettyXml - controls formatting of the returned XML, Boolean.TRUE
requests pretty formatting, e.g. new lines and indentation,
Boolean.FALSE indicates no formatting is required.JAXBException - this occurs if there's a problem converting the passed type
to XMLpublic static ValidationResult fromXml(InputStream toConvert) throws JAXBException
ValidationResult into a
ValidationResult instance.toConvert - an ImputStream holding an XML serialisation of a
ValidationResult.toConvert.JAXBException - when there's an error converting the XMLpublic static void toXml(ValidationResult toConvert, Writer writer, Boolean prettyXml) throws JAXBException
ValidationResult instance into XML which is written to
the passed writer.toConvert - a ValidationResult instance to covert to XMLwriter - an Writer instance, the destination where the XML
representation of the ValidationResult will be written.prettyXml - controls formatting of the returned XML, Boolean.TRUE
requests pretty formatting, e.g. new lines and indentation,
Boolean.FALSE indicates no formatting is required.JAXBException - this occurs if there's a problem converting the passed type
to XMLpublic static ValidationResult fromXml(Reader toConvert) throws JAXBException
ValidationResult into a
ValidationResult instance.toConvert - a Reader instance, holding an XML serialisation of a
ValidationResult.toConvert.JAXBException - when there's an error converting the XMLpublic static String getValidationResultSchema() throws JAXBException, IOException
JAXBException - if there's a problem marshaling the schemaIOException - if there's a problem outputting the resultpublic static ValidationResult stripPassedTests(ValidationResult toStrip)
TestAssertions where
assertion.getStatus() == TestAssertion.Status.PASSED from
toStrip and returns a new ValidationResult without the
passed assertions.toStrip - a ValidationResult to clone without passed
TestAssertionstoStrip, but
without passed TestAssertions.Copyright © 2015–2016 The veraPDF Consortium. All rights reserved.