Package com.github.fge.jsonschema.processors.data

Examples of com.github.fge.jsonschema.processors.data.ValidatorList


    {
        final ObjectNode schema = FACTORY.objectNode();
        final SchemaTree tree
            = new CanonicalSchemaTree(SchemaKey.anonymousKey(), schema);
        final SchemaContext context = new SchemaContext(tree, NodeType.NULL);
        final ValidatorList in = new ValidatorList(context,
            Collections.<KeywordValidator>emptyList());

        final ValidatorList out = processor.process(report, in);

        assertTrue(Lists.newArrayList(out).isEmpty());

        verifyZeroInteractions(report);
    }
View Full Code Here


        final ObjectNode schema = FACTORY.objectNode();
        schema.put("format", "foo");
        final SchemaTree tree
            = new CanonicalSchemaTree(SchemaKey.anonymousKey(), schema);
        final SchemaContext context = new SchemaContext(tree, NodeType.NULL);
        final ValidatorList in = new ValidatorList(context,
            Collections.<KeywordValidator>emptyList());

        final ArgumentCaptor<ProcessingMessage> captor
            = ArgumentCaptor.forClass(ProcessingMessage.class);

        final ValidatorList out = processor.process(report, in);

        assertTrue(Lists.newArrayList(out).isEmpty());

        verify(report).warn(captor.capture());
View Full Code Here

        final ObjectNode schema = FACTORY.objectNode();
        schema.put("format", FMT);
        final SchemaTree tree
            = new CanonicalSchemaTree(SchemaKey.anonymousKey(), schema);
        final SchemaContext context = new SchemaContext(tree, NodeType.NULL);
        final ValidatorList in = new ValidatorList(context,
            Collections.<KeywordValidator>emptyList());

        processor.process(report, in);
        verify(attribute).supportedTypes();
    }
View Full Code Here

        /*
         * Get the full context from the cache. Inject the messages into the
         * main report.
         */
        final ValidatorList fullContext = keywordBuilder.process(report,
            context);

        if (fullContext == null) {
            final ProcessingMessage message = collectSyntaxErrors(report);
            throw new InvalidSchemaException(message);
        }

        /*
         * Get the calculated context. Build the data.
         */
        final SchemaContext newContext = fullContext.getContext();
        final FullData data = new FullData(newContext.getSchema(),
            input.getInstance(), input.isDeepCheck());

        /*
         * Validate against all keywords.
View Full Code Here

        final SchemaTree tree
            = new CanonicalSchemaTree(SchemaKey.anonymousKey(), schema);
        final JsonTree instance = new SimpleJsonTree(node);
        final FullData data = new FullData(tree, instance);
        final SchemaContext context = new SchemaContext(data);
        final ValidatorList in = new ValidatorList(context,
            Collections.<KeywordValidator>emptyList());

        final ValidatorList out = processor.process(report, in);

        final List<KeywordValidator> validators = Lists.newArrayList(out);

        assertEquals(validators.size(), 1);
View Full Code Here

        schema.put("format", FMT);
        final SchemaTree tree
            = new CanonicalSchemaTree(SchemaKey.anonymousKey(), schema);
        final SchemaContext context
            = new SchemaContext(tree, NodeType.getNodeType(node));
        final ValidatorList in = new ValidatorList(context,
            Collections.<KeywordValidator>emptyList());

        final ValidatorList out = processor.process(report, in);

        final List<KeywordValidator> validators = Lists.newArrayList(out);

        assertTrue(validators.isEmpty());
    }
View Full Code Here

        digests.put(K1, JacksonUtils.nodeFactory().nullNode());

        final SchemaDigest digest = new SchemaDigest(null, digests);
        final ProcessingReport report = mock(ProcessingReport.class);

        final ValidatorList context
            = validatorBuilder.process(report, digest);

        final List<KeywordValidator> list = Lists.newArrayList(context);

        assertEquals(list.size(), 1);
View Full Code Here

        digests.put(K2, JacksonUtils.nodeFactory().nullNode());

        final SchemaDigest digest = new SchemaDigest(null, digests);
        final ProcessingReport report = mock(ProcessingReport.class);

        final ValidatorList context
            = validatorBuilder.process(report, digest);

        final List<KeywordValidator> list = Lists.newArrayList(context);

        assertEquals(list.size(), 2);
View Full Code Here

            digest = entry.getValue();
            constructor = constructors.get(keyword);
            validator = buildKeyword(constructor, digest);
            map.put(keyword, validator);
        }
        return new ValidatorList(input.getContext(), map.values());
    }
View Full Code Here

            return input;

        final List<KeywordValidator> validators = Lists.newArrayList(input);
        validators.add(formatValidator(attr));

        return new ValidatorList(context, validators);
    }
View Full Code Here

TOP

Related Classes of com.github.fge.jsonschema.processors.data.ValidatorList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.