Class FilesOutput
java.lang.Object
org.alexmond.yaml.validator.output.FilesOutput
Represents the output format for file validation results.
This class handles the structured output of validation results for multiple files,
providing various output formats including colored console output, JSON, YAML, and JUnit XML.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionFilesOutput(Map<String, com.networknt.schema.output.OutputUnit> files) Constructs a new FilesOutput instance with the given validation results. -
Method Summary
Modifier and TypeMethodDescriptiontoColoredString(boolean color) Converts the validation results to a human-readable string with optional ANSI color formatting.Converts the validation results to a JSON string representation.Converts the validation results to JUnit XML format.Converts the validation results to a YAML string representation.
-
Constructor Details
-
FilesOutput
Constructs a new FilesOutput instance with the given validation results.- Parameters:
files- Map of filename to validation results
-
-
Method Details
-
toColoredString
Converts the validation results to a human-readable string with optional ANSI color formatting.- Parameters:
color- true to enable ANSI color output, false for plain text- Returns:
- formatted string representation of the validation results
-
toJsonString
Converts the validation results to a JSON string representation.- Returns:
- JSON string of the validation results
- Throws:
RuntimeException- if JSON conversion fails
-
toYamlString
Converts the validation results to a YAML string representation.- Returns:
- YAML string of the validation results
- Throws:
RuntimeException- if YAML conversion fails
-
toJunitString
Converts the validation results to JUnit XML format.- Returns:
- JUnit XML string representation of the validation results
-