Class ValidationResultItem

java.lang.Object
net.ionite.docval.validation.ValidationResultItem

public class ValidationResultItem extends Object
Holds the data for a single validation warning or error.
Author:
Ionite
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    The column in the source document where the test failed.
    The line in the source document where the test failed.
    The location of the warning or error, e.g. an XPath, can be null if now known or not relevant
    The message of the warning or error
    The failed test, can be an XPath expression or a general String, such as "XML Schema"
  • Constructor Summary

    Constructors
    Constructor
    Description
    ValidationResultItem(String message, String location, Integer line, Integer column, String test)
    Constructor for the validation result item
  • Method Summary

    Modifier and Type
    Method
    Description
    org.json.JSONObject
    Serialize this validation result item to a JSONObject

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • message

      public String message
      The message of the warning or error
    • location

      public String location
      The location of the warning or error, e.g. an XPath, can be null if now known or not relevant
    • line

      public Integer line
      The line in the source document where the test failed. Can be null if the line is not known
    • column

      public Integer column
      The column in the source document where the test failed. Can be null if the column is not known
    • test

      public String test
      The failed test, can be an XPath expression or a general String, such as "XML Schema"
  • Constructor Details

    • ValidationResultItem

      public ValidationResultItem(String message, String location, Integer line, Integer column, String test)
      Constructor for the validation result item
      Parameters:
      message - The message of the warning or error
      location - The location of the warning or error, e.g. an XPath, can be null if now known or not relevant
      line - The line in the source document where the test failed. Can be null if the line is not known
      column - The column in the source document where the test failed. Can be null if the column is not known
      test - The failed test, can be an XPath expression or a general String, such as "XML Schema"
  • Method Details

    • toJSON

      public org.json.JSONObject toJSON()
      Serialize this validation result item to a JSONObject
      Returns:
      The JSONObject representing this validation result item