Package com.helger.schematron.svrl
Class SVRLHelper
java.lang.Object
com.helger.schematron.svrl.SVRLHelper
Miscellaneous utility methods for handling Schematron output (SVRL).
- Author:
- Philip Helger
-
Method Summary
Modifier and TypeMethodDescriptionstatic com.helger.commons.collection.impl.ICommonsList<DiagnosticReference> static com.helger.commons.collection.impl.ICommonsList<DiagnosticReference> static com.helger.commons.collection.impl.ICommonsList<SVRLFailedAssert> getAllFailedAssertions(SchematronOutputType aSchematronOutput) Get a list of all failed assertions in a given schematron output.static com.helger.commons.collection.impl.ICommonsList<AbstractSVRLMessage> getAllFailedAssertionsAndSuccessfulReports(SchematronOutputType aSchematronOutput) Get a list of all failed assertions and successful reports in a given schematron output.static com.helger.commons.collection.impl.ICommonsList<SVRLFailedAssert> getAllFailedAssertionsMoreOrEqualSevereThan(SchematronOutputType aSchematronOutput, com.helger.commons.error.level.IErrorLevel aErrorLevel) Get a list of all failed assertions in a given schematron output, with an error level equally or more severe than the passed error level.static com.helger.commons.collection.impl.ICommonsList<PropertyReference> static com.helger.commons.collection.impl.ICommonsList<PropertyReference> static com.helger.commons.collection.impl.ICommonsList<SVRLSuccessfulReport> getAllSuccessfulReports(SchematronOutputType aSchematronOutput) Get a list of all successful reports in a given schematron output.static com.helger.commons.collection.impl.ICommonsList<SVRLSuccessfulReport> getAllSuccessfulReportsMoreOrEqualSevereThan(SchematronOutputType aSchematronOutput, com.helger.commons.error.level.IErrorLevel aErrorLevel) Get a list of all successful reports in a given schematron output, with an error level equally or more severe than the passed error level.static StringgetAsString(Text aText) static StringgetBeautifiedLocation(String sLocation) Convert an "unsexy" location string in the for, of*:xx[namespace-uri()='yy']to something more readable likeprefix:xxby using the mapping registered in theSVRLLocationBeautifierRegistry.static StringgetBeautifiedLocation(String sLocation, ISVRLLocationBeautifier aLocationBeautifier) Convert an "unsexy" location string in the for, of*:xx[namespace-uri()='yy']to something more readable likeprefix:xxby using the mapping registered in theSVRLLocationBeautifierRegistry.static ISVRLErrorLevelDeterminatorstatic com.helger.commons.error.level.IErrorLevelgetErrorLevelFromFailedAssert(FailedAssert aFailedAssert) Get the error level associated with a single failed assertion.static com.helger.commons.error.level.IErrorLevelgetErrorLevelFromSuccessfulReport(SuccessfulReport aSuccessfulReport) Get the error level associated with a single successful report.static TextgetText(FailedAssert aFA) static TextgetText(SuccessfulReport aSR) static voidSet the global error level determinator.
-
Method Details
-
getAsString
-
getAllFailedAssertions
@Nonnull @ReturnsMutableCopy public static com.helger.commons.collection.impl.ICommonsList<SVRLFailedAssert> getAllFailedAssertions(@Nullable SchematronOutputType aSchematronOutput) Get a list of all failed assertions in a given schematron output.- Parameters:
aSchematronOutput- The schematron output to be used. May benull.- Returns:
- A non-
nulllist with all failed assertions.
-
getAllFailedAssertionsMoreOrEqualSevereThan
@Nonnull @ReturnsMutableCopy public static com.helger.commons.collection.impl.ICommonsList<SVRLFailedAssert> getAllFailedAssertionsMoreOrEqualSevereThan(@Nullable SchematronOutputType aSchematronOutput, @Nonnull com.helger.commons.error.level.IErrorLevel aErrorLevel) Get a list of all failed assertions in a given schematron output, with an error level equally or more severe than the passed error level.- Parameters:
aSchematronOutput- The schematron output to be used. May benull.aErrorLevel- Minimum error level to be queried- Returns:
- A non-
nulllist with all failed assertions.
-
getAllSuccessfulReports
@Nonnull @ReturnsMutableCopy public static com.helger.commons.collection.impl.ICommonsList<SVRLSuccessfulReport> getAllSuccessfulReports(@Nullable SchematronOutputType aSchematronOutput) Get a list of all successful reports in a given schematron output.- Parameters:
aSchematronOutput- The schematron output to be used. May benull.- Returns:
- A non-
nulllist with all successful reports.
-
getAllSuccessfulReportsMoreOrEqualSevereThan
@Nonnull @ReturnsMutableCopy public static com.helger.commons.collection.impl.ICommonsList<SVRLSuccessfulReport> getAllSuccessfulReportsMoreOrEqualSevereThan(@Nullable SchematronOutputType aSchematronOutput, @Nonnull com.helger.commons.error.level.IErrorLevel aErrorLevel) Get a list of all successful reports in a given schematron output, with an error level equally or more severe than the passed error level.- Parameters:
aSchematronOutput- The schematron output to be used. May benull.aErrorLevel- Minimum error level to be queried- Returns:
- A non-
nulllist with all successful reports.
-
getAllFailedAssertionsAndSuccessfulReports
@Nonnull @ReturnsMutableCopy public static com.helger.commons.collection.impl.ICommonsList<AbstractSVRLMessage> getAllFailedAssertionsAndSuccessfulReports(@Nullable SchematronOutputType aSchematronOutput) Get a list of all failed assertions and successful reports in a given schematron output.- Parameters:
aSchematronOutput- The schematron output to be used. May benull.- Returns:
- A non-
nulllist with all failed assertions and successful reports. Maybe an empty list if the input isnull.
-
getErrorLevelFromFailedAssert
@Nonnull public static com.helger.commons.error.level.IErrorLevel getErrorLevelFromFailedAssert(@Nonnull FailedAssert aFailedAssert) Get the error level associated with a single failed assertion.- Parameters:
aFailedAssert- The failed assert to be queried. May not benull.- Returns:
- The error level and never
null.
-
getErrorLevelFromSuccessfulReport
@Nonnull public static com.helger.commons.error.level.IErrorLevel getErrorLevelFromSuccessfulReport(@Nonnull SuccessfulReport aSuccessfulReport) Get the error level associated with a single successful report.- Parameters:
aSuccessfulReport- The failed assert to be queried. May not benull.- Returns:
- The error level and never
null.
-
getErrorLevelDeterminator
- Returns:
- The default error level determinator. May not be
null.
-
setErrorLevelDeterminator
Set the global error level determinator.- Parameters:
aELD- The determinator to use. May not benull.
-
getBeautifiedLocation
Convert an "unsexy" location string in the for, of*:xx[namespace-uri()='yy']to something more readable likeprefix:xxby using the mapping registered in theSVRLLocationBeautifierRegistry.- Parameters:
sLocation- The original location string. May not benull.- Returns:
- The beautified string. Never
null. Might be identical to the original string if the pattern was not found. - Since:
- 5.0.1
-
getBeautifiedLocation
@Nonnull public static String getBeautifiedLocation(@Nonnull String sLocation, @Nonnull ISVRLLocationBeautifier aLocationBeautifier) Convert an "unsexy" location string in the for, of*:xx[namespace-uri()='yy']to something more readable likeprefix:xxby using the mapping registered in theSVRLLocationBeautifierRegistry.- Parameters:
sLocation- The original location string. May not benull.aLocationBeautifier- The location beautifier to be used. May not benull.- Returns:
- The beautified string. Never
null. Might be identical to the original string if the pattern was not found. - Since:
- 6.0.4
-
getAllDiagnosticReferences
@Nonnull public static com.helger.commons.collection.impl.ICommonsList<DiagnosticReference> getAllDiagnosticReferences(@Nonnull FailedAssert aFA) -
getAllPropertyReferences
@Nonnull public static com.helger.commons.collection.impl.ICommonsList<PropertyReference> getAllPropertyReferences(@Nonnull FailedAssert aFA) -
getText
-
getAllDiagnosticReferences
@Nonnull public static com.helger.commons.collection.impl.ICommonsList<DiagnosticReference> getAllDiagnosticReferences(@Nonnull SuccessfulReport aSR) -
getAllPropertyReferences
@Nonnull public static com.helger.commons.collection.impl.ICommonsList<PropertyReference> getAllPropertyReferences(@Nonnull SuccessfulReport aSR) -
getText
-