Skip to content

Commit c0d2d9c

Browse files
committed
Rename preloadJsonSchema in KeywordValidator to preloadSchema
1 parent 142d92f commit c0d2d9c

26 files changed

+46
-46
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* This doesn't extend off SchemaException as it is used for flow control
2727
* and is intended to be caught in a specific place.
2828
* <p>
29-
* This will be caught in the JsonSchema validate method to be passed to the
29+
* This will be caught in the Schema validate method to be passed to the
3030
* output formatter.
3131
*/
3232
public class FailFastAssertionException extends RuntimeException {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@
4444
* be cached for performance.
4545
* <p>
4646
* This is the core of json constraint implementation. It parses json constraint
47-
* file and generates JsonValidators. The class is thread safe, once it is
47+
* file and generates KeywordValidators. The class is thread safe, once it is
4848
* constructed, it can be used to validate multiple json data concurrently.
4949
* <p>
50-
* JsonSchema instances are thread-safe provided its configuration is not
50+
* Schema instances are thread-safe provided its configuration is not
5151
* modified.
5252
*/
5353
public class Schema implements Validator {
@@ -1365,7 +1365,7 @@ public List<KeywordValidator> getValidators() {
13651365
public void initializeValidators() {
13661366
if (!this.validatorsLoaded) {
13671367
for (final KeywordValidator validator : getValidators()) {
1368-
validator.preloadJsonSchema();
1368+
validator.preloadSchema();
13691369
}
13701370
/*
13711371
* This is only set to true after the preload as it may throw an exception for

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ protected Schema newSchema(final SchemaLocation schemaUri, final JsonNode schema
304304
* @param config containing the configuration option
305305
*/
306306
private void preload(Schema schema) {
307-
if (this.getSchemaRegistryConfig().isPreloadJsonSchema()) {
307+
if (this.getSchemaRegistryConfig().isPreloadSchema()) {
308308
try {
309309
/*
310310
* Attempt to preload and resolve $refs for performance.
@@ -358,7 +358,7 @@ private SchemaContext withDialect(SchemaContext schemaContext, JsonNode schemaNo
358358
* one with a null base IRI.
359359
* <p>
360360
* Note that the resolving of the $id or id in the schema node will take place
361-
* in the JsonSchema constructor.
361+
* in the Schema constructor.
362362
*
363363
* @param schemaLocation the schema retrieval uri
364364
* @return the schema location

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ public boolean isLosslessNarrowing() {
281281
*
282282
* @return true if it should be preloaded
283283
*/
284-
public boolean isPreloadJsonSchema() {
284+
public boolean isPreloadSchema() {
285285
return preloadSchema;
286286
}
287287

@@ -511,11 +511,11 @@ public T pathType(PathType pathType) {
511511
* <p>
512512
* Defaults to true.
513513
*
514-
* @param preloadJsonSchema true to preload
514+
* @param preloadSchema true to preload
515515
* @return the builder
516516
*/
517-
public T preloadJsonSchema(boolean preloadJsonSchema) {
518-
this.preloadSchema = preloadJsonSchema;
517+
public T preloadSchema(boolean preloadSchema) {
518+
this.preloadSchema = preloadSchema;
519519
return self();
520520
}
521521
/**

src/main/java/com/networknt/schema/keyword/AdditionalPropertiesValidator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ private boolean hasUnevaluatedPropertiesValidator() {
192192
}
193193

194194
@Override
195-
public void preloadJsonSchema() {
195+
public void preloadSchema() {
196196
if(additionalPropertiesSchema != null) {
197197
additionalPropertiesSchema.initializeValidators();
198198
}

src/main/java/com/networknt/schema/keyword/AllOfValidator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public void walk(ExecutionContext executionContext, JsonNode node, JsonNode root
110110
}
111111

112112
@Override
113-
public void preloadJsonSchema() {
114-
preloadJsonSchemas(this.schemas);
113+
public void preloadSchema() {
114+
preloadSchemas(this.schemas);
115115
}
116116
}

src/main/java/com/networknt/schema/keyword/AnyOfValidator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ protected boolean canShortCircuit() {
216216
}
217217

218218
@Override
219-
public void preloadJsonSchema() {
220-
preloadJsonSchemas(this.schemas);
219+
public void preloadSchema() {
220+
preloadSchemas(this.schemas);
221221
canShortCircuit(); // cache flag
222222
}
223223
}

src/main/java/com/networknt/schema/keyword/BaseKeywordValidator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ protected String getNodeFieldType() {
118118
return null;
119119
}
120120

121-
protected void preloadJsonSchemas(final Collection<Schema> schemas) {
121+
protected void preloadSchemas(final Collection<Schema> schemas) {
122122
for (final Schema schema : schemas) {
123123
schema.initializeValidators();
124124
}

src/main/java/com/networknt/schema/keyword/ContainsValidator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public void validate(ExecutionContext executionContext, JsonNode node, JsonNode
179179
}
180180

181181
@Override
182-
public void preloadJsonSchema() {
182+
public void preloadSchema() {
183183
Optional.ofNullable(this.schema).ifPresent(Schema::initializeValidators);
184184
collectAnnotations(); // cache the flag
185185
}

src/main/java/com/networknt/schema/keyword/DependenciesValidator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public void validate(ExecutionContext executionContext, JsonNode node, JsonNode
8585
}
8686

8787
@Override
88-
public void preloadJsonSchema() {
89-
preloadJsonSchemas(schemaDeps.values());
88+
public void preloadSchema() {
89+
preloadSchemas(schemaDeps.values());
9090
}
9191
}

0 commit comments

Comments
 (0)