Package com.networknt.schema
Class ValidationMessage
- java.lang.Object
-
- com.networknt.schema.ValidationMessage
-
public class ValidationMessage extends java.lang.Object
The output format.- See Also:
- JSON Schema
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ValidationMessage.Builder
static class
ValidationMessage.BuilderSupport<S>
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Object[]
arguments
private java.lang.String
code
private java.util.Map<java.lang.String,java.lang.Object>
details
private JsonNodePath
evaluationPath
private JsonNodePath
instanceLocation
private com.fasterxml.jackson.databind.JsonNode
instanceNode
private java.lang.String
messageKey
private java.util.function.Supplier<java.lang.String>
messageSupplier
private java.lang.String
property
private SchemaLocation
schemaLocation
private com.fasterxml.jackson.databind.JsonNode
schemaNode
private java.lang.String
type
-
Constructor Summary
Constructors Constructor Description ValidationMessage(java.lang.String type, java.lang.String code, JsonNodePath evaluationPath, SchemaLocation schemaLocation, JsonNodePath instanceLocation, java.lang.String property, java.lang.Object[] arguments, java.util.Map<java.lang.String,java.lang.Object> details, java.lang.String messageKey, java.util.function.Supplier<java.lang.String> messageSupplier, com.fasterxml.jackson.databind.JsonNode instanceNode, com.fasterxml.jackson.databind.JsonNode schemaNode)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ValidationMessage.Builder
builder()
boolean
equals(java.lang.Object o)
java.lang.Object[]
getArguments()
java.lang.String
getCode()
java.util.Map<java.lang.String,java.lang.Object>
getDetails()
java.lang.String
getError()
Gets the error.JsonNodePath
getEvaluationPath()
The evaluation path is the set of keys, starting from the schema root, through which evaluation passes to reach the schema object that produced a specific result.JsonNodePath
getInstanceLocation()
The instance location is the location of the JSON value within the root instance being validated.com.fasterxml.jackson.databind.JsonNode
getInstanceNode()
Returns the instance node which was evaluated.java.lang.String
getMessage()
Gets the formatted error message.java.lang.String
getMessageKey()
java.lang.String
getProperty()
Returns the property with the error.SchemaLocation
getSchemaLocation()
The schema location is the canonical IRI of the schema object plus a JSON Pointer fragment indicating the subschema that produced a result.com.fasterxml.jackson.databind.JsonNode
getSchemaNode()
Returns the schema node which was evaluated.java.lang.String
getType()
int
hashCode()
boolean
isValid()
java.lang.String
toString()
-
-
-
Field Detail
-
type
private final java.lang.String type
-
code
private final java.lang.String code
-
evaluationPath
private final JsonNodePath evaluationPath
-
schemaLocation
private final SchemaLocation schemaLocation
-
instanceLocation
private final JsonNodePath instanceLocation
-
property
private final java.lang.String property
-
arguments
private final java.lang.Object[] arguments
-
messageKey
private final java.lang.String messageKey
-
messageSupplier
private final java.util.function.Supplier<java.lang.String> messageSupplier
-
details
private final java.util.Map<java.lang.String,java.lang.Object> details
-
instanceNode
private final com.fasterxml.jackson.databind.JsonNode instanceNode
-
schemaNode
private final com.fasterxml.jackson.databind.JsonNode schemaNode
-
-
Constructor Detail
-
ValidationMessage
ValidationMessage(java.lang.String type, java.lang.String code, JsonNodePath evaluationPath, SchemaLocation schemaLocation, JsonNodePath instanceLocation, java.lang.String property, java.lang.Object[] arguments, java.util.Map<java.lang.String,java.lang.Object> details, java.lang.String messageKey, java.util.function.Supplier<java.lang.String> messageSupplier, com.fasterxml.jackson.databind.JsonNode instanceNode, com.fasterxml.jackson.databind.JsonNode schemaNode)
-
-
Method Detail
-
getCode
public java.lang.String getCode()
-
getInstanceLocation
public JsonNodePath getInstanceLocation()
The instance location is the location of the JSON value within the root instance being validated.- Returns:
- The path to the input json
-
getEvaluationPath
public JsonNodePath getEvaluationPath()
The evaluation path is the set of keys, starting from the schema root, through which evaluation passes to reach the schema object that produced a specific result.- Returns:
- the evaluation path
-
getSchemaLocation
public SchemaLocation getSchemaLocation()
The schema location is the canonical IRI of the schema object plus a JSON Pointer fragment indicating the subschema that produced a result. In contrast with the evaluation path, the schema location MUST NOT include by-reference applicators such as $ref or $dynamicRef.- Returns:
- the schema location
-
getInstanceNode
public com.fasterxml.jackson.databind.JsonNode getInstanceNode()
Returns the instance node which was evaluated.This corresponds with the instance location.
- Returns:
- the instance node
-
getSchemaNode
public com.fasterxml.jackson.databind.JsonNode getSchemaNode()
Returns the schema node which was evaluated.This corresponds with the schema location.
- Returns:
- the schema node
-
getProperty
public java.lang.String getProperty()
Returns the property with the error.For instance, for the required validator the instance location does not contain the missing property name as the instance must refer to the input data.
- Returns:
- the property name
-
getArguments
public java.lang.Object[] getArguments()
-
getDetails
public java.util.Map<java.lang.String,java.lang.Object> getDetails()
-
getMessage
public java.lang.String getMessage()
Gets the formatted error message.- Returns:
- the error message
-
getMessageKey
public java.lang.String getMessageKey()
-
isValid
public boolean isValid()
-
getError
public java.lang.String getError()
Gets the error.- Returns:
- the error
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getType
public java.lang.String getType()
-
builder
public static ValidationMessage.Builder builder()
-
-