|
35 | 35 | import com.networknt.schema.utils.Strings; |
36 | 36 | import com.networknt.schema.vocabulary.Vocabularies; |
37 | 37 | import com.networknt.schema.vocabulary.Vocabulary; |
38 | | -import com.networknt.schema.vocabulary.VocabularyFactory; |
| 38 | +import com.networknt.schema.vocabulary.VocabularyRegistry; |
39 | 39 |
|
40 | 40 | import org.slf4j.Logger; |
41 | 41 | import org.slf4j.LoggerFactory; |
@@ -81,7 +81,7 @@ public static class Builder { |
81 | 81 | private final Map<String, Format> formats = new HashMap<>(); |
82 | 82 | private final Map<String, Boolean> vocabularies = new HashMap<>(); |
83 | 83 | private FormatKeywordFactory formatKeywordFactory = null; |
84 | | - private VocabularyFactory vocabularyFactory = null; |
| 84 | + private VocabularyRegistry vocabularyRegistry = null; |
85 | 85 | private KeywordFactory unknownKeywordFactory = null; |
86 | 86 |
|
87 | 87 | public Builder(String id) { |
@@ -124,13 +124,13 @@ public Builder formatKeywordFactory(FormatKeywordFactory formatKeywordFactory) { |
124 | 124 | } |
125 | 125 |
|
126 | 126 | /** |
127 | | - * Sets the vocabulary factory for handling custom vocabularies. |
| 127 | + * Sets the vocabulary registry for handling custom vocabularies. |
128 | 128 | * |
129 | | - * @param vocabularyFactory the factory |
| 129 | + * @param vocabularyRegistry the registry |
130 | 130 | * @return the builder |
131 | 131 | */ |
132 | | - public Builder vocabularyFactory(VocabularyFactory vocabularyFactory) { |
133 | | - this.vocabularyFactory = vocabularyFactory; |
| 132 | + public Builder vocabularyRegistry(VocabularyRegistry vocabularyRegistry) { |
| 133 | + this.vocabularyRegistry = vocabularyRegistry; |
134 | 134 | return this; |
135 | 135 | } |
136 | 136 |
|
@@ -293,8 +293,8 @@ public Dialect build() { |
293 | 293 | for(Entry<String, Boolean> entry : this.vocabularies.entrySet()) { |
294 | 294 | Vocabulary vocabulary = null; |
295 | 295 | String id = entry.getKey(); |
296 | | - if (this.vocabularyFactory != null) { |
297 | | - vocabulary = this.vocabularyFactory.getVocabulary(id); |
| 296 | + if (this.vocabularyRegistry != null) { |
| 297 | + vocabulary = this.vocabularyRegistry.getVocabulary(id); |
298 | 298 | } |
299 | 299 | if (vocabulary == null) { |
300 | 300 | vocabulary = Vocabularies.getVocabulary(id); |
@@ -385,7 +385,7 @@ public static Builder builder(Dialect blueprint) { |
385 | 385 | .formats(blueprint.builder.formats.values()) |
386 | 386 | .specificationVersion(blueprint.getSpecificationVersion()) |
387 | 387 | .vocabularies(vocabularies) |
388 | | - .vocabularyFactory(blueprint.builder.vocabularyFactory) |
| 388 | + .vocabularyRegistry(blueprint.builder.vocabularyRegistry) |
389 | 389 | .formatKeywordFactory(blueprint.builder.formatKeywordFactory) |
390 | 390 | .unknownKeywordFactory(blueprint.builder.unknownKeywordFactory) |
391 | 391 | ; |
|
0 commit comments