Skip to content

Commit 34b8c17

Browse files
committed
Rename JsonSchemaWalker to Walker
1 parent 8c522b2 commit 34b8c17

File tree

3 files changed

+32
-31
lines changed

3 files changed

+32
-31
lines changed

src/main/java/com/networknt/schema/JsonSchemaValidator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
package com.networknt.schema;
1818

1919
import com.fasterxml.jackson.databind.JsonNode;
20-
import com.networknt.schema.walk.JsonSchemaWalker;
20+
import com.networknt.schema.walk.Walker;
2121

2222
/**
2323
* Standard json validator interface, implemented by all validators and JsonSchema.
2424
*/
25-
public interface JsonSchemaValidator extends JsonSchemaWalker {
25+
public interface JsonSchemaValidator extends Walker {
2626
/**
2727
* Validate the given JsonNode, the given node is the child node of the root node at given
2828
* data path.

src/main/java/com/networknt/schema/walk/JsonSchemaWalker.java

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.networknt.schema.walk;
2+
3+
import com.fasterxml.jackson.databind.JsonNode;
4+
import com.networknt.schema.JsonSchemaValidator;
5+
import com.networknt.schema.ExecutionContext;
6+
import com.networknt.schema.JsonNodePath;
7+
8+
public interface Walker {
9+
/**
10+
*
11+
* This method gives the capability to walk through the given JsonNode, allowing
12+
* functionality beyond validation like collecting information,handling
13+
* cross-cutting concerns like logging or instrumentation. This method also
14+
* performs the validation if {@code shouldValidateSchema} is set to true. <br>
15+
* <br>
16+
* {@link JsonSchemaValidator#walk(ExecutionContext, JsonNode, JsonNode, JsonNodePath, boolean)}
17+
* provides a default implementation of this method. However, validators that
18+
* parse sub-schemas should override this method to call walk method on those
19+
* sub-schemas.
20+
*
21+
* @param executionContext the execution context
22+
* @param instanceNode the instance node being processed
23+
* @param instance the instance document that the instance node
24+
* belongs to
25+
* @param instanceLocation the location of the instance node being processed
26+
* @param shouldValidateSchema true to validate the schema while walking
27+
*/
28+
void walk(ExecutionContext executionContext, JsonNode instanceNode, JsonNode instance,
29+
JsonNodePath instanceLocation, boolean shouldValidateSchema);
30+
}

0 commit comments

Comments
 (0)