Package com.networknt.schema.walk
Class WalkEvent
- java.lang.Object
-
- com.networknt.schema.walk.WalkEvent
-
public class WalkEvent extends java.lang.Object
Encapsulation of Walk data that is passed into theJsonSchemaWalkListener
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
WalkEvent.WalkEventBuilder
-
Field Summary
Fields Modifier and Type Field Description private ExecutionContext
executionContext
private JsonNodePath
instanceLocation
private com.fasterxml.jackson.databind.JsonNode
instanceNode
private java.lang.String
keyword
private com.fasterxml.jackson.databind.JsonNode
rootNode
private JsonSchema
schema
private JsonValidator
validator
-
Constructor Summary
Constructors Constructor Description WalkEvent()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static WalkEvent.WalkEventBuilder
builder()
ExecutionContext
getExecutionContext()
Gets the execution context.JsonNodePath
getInstanceLocation()
Gets the instance location of the instance node.com.fasterxml.jackson.databind.JsonNode
getInstanceNode()
Gets the instance node.java.lang.String
getKeyword()
Gets the keyword.com.fasterxml.jackson.databind.JsonNode
getRootNode()
Gets the root instance node.JsonSchema
getSchema()
Gets the schema that will be used to evaluate the instance node.<T extends JsonValidator>
TgetValidator()
Gets the validator that corresponds with the keyword.java.lang.String
toString()
-
-
-
Field Detail
-
executionContext
private ExecutionContext executionContext
-
schema
private JsonSchema schema
-
keyword
private java.lang.String keyword
-
rootNode
private com.fasterxml.jackson.databind.JsonNode rootNode
-
instanceNode
private com.fasterxml.jackson.databind.JsonNode instanceNode
-
instanceLocation
private JsonNodePath instanceLocation
-
validator
private JsonValidator validator
-
-
Method Detail
-
getExecutionContext
public ExecutionContext getExecutionContext()
Gets the execution context.As the listeners should be state-less, this allows listeners to store data in the collector context.
- Returns:
- the execution context
-
getSchema
public JsonSchema getSchema()
Gets the schema that will be used to evaluate the instance node.For the keyword listener, this will allow getting the validator for the given keyword.
- Returns:
- the schema
-
getKeyword
public java.lang.String getKeyword()
Gets the keyword.- Returns:
- the keyword
-
getRootNode
public com.fasterxml.jackson.databind.JsonNode getRootNode()
Gets the root instance node.This makes it possible to get the parent node, for instance by getting the instance location parent and using the root node.
- Returns:
- the root node
-
getInstanceNode
public com.fasterxml.jackson.databind.JsonNode getInstanceNode()
Gets the instance node.- Returns:
- the instance node
-
getInstanceLocation
public JsonNodePath getInstanceLocation()
Gets the instance location of the instance node.- Returns:
- the instance location of the instance node
-
getValidator
public <T extends JsonValidator> T getValidator()
Gets the validator that corresponds with the keyword.- Type Parameters:
T
- the type of the validator- Returns:
- the validator
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
builder
public static WalkEvent.WalkEventBuilder builder()
-
-