public ValidatorBuilder( final Dictionary<KeywordValidatorFactory> dict) { factories = dict.entries(); }
public SchemaDigester(final Dictionary<Digester> dict) { String keyword; Digester digester; final Map<String, Digester> map = dict.entries(); for (final Map.Entry<String, Digester> entry: map.entrySet()) { keyword = entry.getKey(); digester = entry.getValue(); digesterMap.put(keyword, digester); for (final NodeType type: digester.supportedTypes()) typeMap.put(type, keyword); } }
@VisibleForTesting FormatProcessor(final Dictionary<FormatAttribute> dict) { attributes = dict.entries(); bundle = MessageBundles.getBundle(JsonSchemaValidationBundle.class); }
public ValidatorBuilder(final Library library) { factories = library.getValidators().entries(); }
protected CallbackValidatorTest( final Dictionary<KeywordValidatorFactory> dict, final String keyword, final JsonPointer ptr1, final JsonPointer ptr2) { this.keyword = keyword; factory = dict.entries().get(keyword); this.ptr1 = ptr1; this.ptr2 = ptr2; }
public FormatProcessor(final Library library, final ValidationConfiguration cfg) { attributes = library.getFormatAttributes().entries(); bundle = cfg.getValidationMessages(); }
protected AbstractKeywordValidatorTest( final Dictionary<KeywordValidatorFactory> dict, final String prefix, final String keyword) throws IOException { this.keyword = keyword; factory = dict.entries().get(keyword); final String resourceName = String.format("/keyword/validators/%s/%s.json", prefix, keyword); testNode = JsonLoader.fromResource(resourceName); }
protected AbstractFormatAttributeTest( final Dictionary<FormatAttribute> dict, final String prefix, final String fmt) throws IOException { final String resourceName = String.format("/format/%s/%s.json", prefix, fmt); this.fmt = fmt; testNode = JsonLoader.fromResource(resourceName); attribute = dict.entries().get(fmt); }
protected AbstractDigesterTest(final Dictionary<Digester> dict, final String prefix, final String keyword, final NodeType first, final NodeType... other) throws IOException { digester = dict.entries().get(keyword); types = EnumSet.of(first, other); this.keyword = keyword; final String resourceName = String.format("/keyword/digest/%s/%s.json", prefix, keyword); data = JsonLoader.fromResource(resourceName); }
public PatternKeywordTest() throws IOException { factory = CommonValidatorDictionary.get().entries().get("pattern"); testData = JsonLoader.fromResource("/keyword/special/pattern.json"); }
public ExtendsKeywordTest() throws ProcessingException { final KeywordValidatorFactory factory = DraftV3ValidatorDictionary.get().entries().get("extends"); validator = factory == null ? null : factory.getKeywordValidator(FACTORY.nullNode()); }
public NotKeywordTest() throws ProcessingException { final KeywordValidatorFactory factory = DraftV4ValidatorDictionary.get().entries().get("not"); validator = factory == null ? null : factory.getKeywordValidator(FACTORY.nullNode()); }
/** * Constructor * * @param bundle message bundle used by this syntax checker * @param dict dictionary of syntax checkers */ public SyntaxProcessor(final MessageBundle bundle, final Dictionary<SyntaxChecker> dict) { super("schema", "schema"); this.bundle = bundle; checkers = dict.entries(); }
/** * Constructor * * @param bundle message bundle used by this syntax checker * @param dict dictionary of syntax checkers */ public SyntaxProcessor(final MessageBundle bundle, final Dictionary<SyntaxChecker> dict) { super("schema", "schema"); this.bundle = bundle; checkers = dict.entries(); }
/** * Constructor * * @param bundle message bundle used by this syntax checker * @param dict dictionary of syntax checkers */ public SyntaxProcessor(final MessageBundle bundle, final Dictionary<SyntaxChecker> dict) { super("schema", "schema"); this.bundle = bundle; checkers = dict.entries(); }
@Test public void removedValueCannotBeRetrieved() { builder.addEntry(KEY, MOCK1); builder.removeEntry(KEY); assertNull(builder.freeze().entries().get(KEY)); }
@Test public void insertedValueCanBeRetrieved() { builder.addEntry(KEY, MOCK1); assertSame(builder.freeze().entries().get(KEY), MOCK1); }
@Test public void valuesCanBeOverwritten() { builder.addEntry(KEY, MOCK1); builder.addEntry(KEY, MOCK2); assertSame(builder.freeze().entries().get(KEY), MOCK2); } }
checker = dict.entries().get(keyword); invalidTypes = checker == null ? null : EnumSet.complementOf(checker.getValidTypes());