java.lang.Object
dev.metaschema.core.model.validation.AbstractValidationResultProcessor
dev.metaschema.cli.util.LoggingValidationHandler
Supports logging validation findings to the console using ANSI color codes to
improve the visibility of warnings and errors.
-
Method Summary
Modifier and TypeMethodDescriptionprotected voidProcess the Metaschema module constraint validation finding.protected voidProcess the JSON validation finding.protected voidProcess the XML validation finding.static LoggingValidationHandlerinstance()Get a singleton instance of the logging validation handler.static LoggingValidationHandlerinstance(boolean logExceptions) Get a singleton instance of the logging validation handler.booleanDetermine if exceptions should be logged.static LoggingValidationHandlerwithPathFormatter(IPathFormatter pathFormatter) Create a new logging validation handler with a custom path formatter.static LoggingValidationHandlerwithSettings(boolean logExceptions, IPathFormatter pathFormatter) Create a new logging validation handler with custom settings.Methods inherited from class dev.metaschema.core.model.validation.AbstractValidationResultProcessor
handleResults, handleValidationFindings
-
Method Details
-
instance
Get a singleton instance of the logging validation handler.This instance will not log exceptions.
- Returns:
- the instance
-
instance
Get a singleton instance of the logging validation handler.- Parameters:
logExceptions-trueif this instance will log exceptions orfalseotherwise- Returns:
- the instance
-
withPathFormatter
@NonNull public static LoggingValidationHandler withPathFormatter(@NonNull IPathFormatter pathFormatter) Create a new logging validation handler with a custom path formatter.- Parameters:
pathFormatter- the path formatter to use for constraint validation findings- Returns:
- a new handler instance
-
withSettings
@NonNull public static LoggingValidationHandler withSettings(boolean logExceptions, @NonNull IPathFormatter pathFormatter) Create a new logging validation handler with custom settings.- Parameters:
logExceptions-trueif this instance will log exceptions orfalseotherwisepathFormatter- the path formatter to use for constraint validation findings- Returns:
- a new handler instance
-
isLogExceptions
public boolean isLogExceptions()Determine if exceptions should be logged.- Returns:
trueif exceptions are logged orfalseotherwise
-
handleJsonValidationFinding
protected void handleJsonValidationFinding(@NonNull JsonSchemaContentValidator.JsonValidationFinding finding) Description copied from class:AbstractValidationResultProcessorProcess the JSON validation finding.- Specified by:
handleJsonValidationFindingin classAbstractValidationResultProcessor- Parameters:
finding- the validation finding to process
-
handleXmlValidationFinding
Description copied from class:AbstractValidationResultProcessorProcess the XML validation finding.- Specified by:
handleXmlValidationFindingin classAbstractValidationResultProcessor- Parameters:
finding- the validation finding to process
-
handleConstraintValidationFinding
Description copied from class:AbstractValidationResultProcessorProcess the Metaschema module constraint validation finding.- Specified by:
handleConstraintValidationFindingin classAbstractValidationResultProcessor- Parameters:
finding- the validation finding to process
-